Thursday, March 12, 2009

Silverlight Data Grid & Stretching Columns

In Silverlight data grid, often we run into situations where there is a lot of empty space after the last column. What we want instead is that the last column should stretch to the very end of the data grid.


Here is small function that I wrote which will take care of that. It's not that elegant, but will get the job done.


void ResizeColumns()
{
int NumColumns = DataGridEntities.Columns.Count;
if (NumColumns > 0)
{
double DataGridWidth = DataGridEntities.ActualWidth;
double TotalColumnsWidth = 0;
for (int ii = 0; ii < NumColumns - 1; ii++)
{
TotalColumnsWidth += DataGridEntities.Columns[ii].ActualWidth;
}
double LastColumnWidth = DataGridEntities.Columns[NumColumns - 1].ActualWidth;
double EmptySpace = DataGridWidth - (TotalColumnsWidth + LastColumnWidth);
if (EmptySpace > 0)
{
DataGridEntities.Columns[NumColumns - 1].Width = new DataGridLength(LastColumnWidth + EmptySpace);
}
}
}










Basically after databinding is done on the data grid, we have data grid's and it's columns actual . What we do is add up all column's actual width, find the difference between the two and add it to the last column's width.


I know it's not elegant but will get the job done.


Comments, Suggestions!!!


Gaurav

Tuesday, March 10, 2009

SDS Strategy : Mid Term Correction?

Today Microsoft announced a change of plans on their SDS platform (http://blogs.msdn.com/ssds/archive/2009/03/10/9469228.aspx). Essentially in short they are getting rid of ACE model and adopting a relational model. It is indeed a very shocking development especially for people (like us) who have invested some time & energy in adopting this technology. As Roger Jennings posted in MSDN forums (http://social.msdn.microsoft.com/Forums/en-US/ssdsgetstarted/thread/c1418815-a391-46f3-95cd-4c21856acde0), "That's a lotta work by the SSDS, SDS, and Astoria teams to throw down the drain."

I personally believe that this change is for good and I am looking forward to see what new they have in store for us. At Cerebrata, our interest in this is purely from tooling point of view and I would be interested in learning more about the mechanisms by which metadata of the database hosted in the cloud is exposed to the developers.

One thing I do think led to this, is the way this technology has been pitched to the developer community. If you name your platform as SQL Server Data Services (later change it to SQL Data Services), general perception would be to have same set of capabilities as you would expect from your SQL Server. Unfortunately with ACE model, it was just not possible. IMHO, if Microsoft has not pitched it as SQL Server on the cloud (I don't really care if you are storing my authorities, containers and entities in a SQL Server or not), things would have been fine and it would have been accepted as an alternate storage mechanism.

Like I said, next few months would be interesting to see how this new SDS evolves. I am hoping when they come out with new beta now they will have answers to issues other than technology (like compliance etc.) which will be extremely critical for adoption at enterprise level.

Cheers!!!

Gaurav

Thursday, February 19, 2009

Omega.SDSClient now has query support

A new version of Omega.SDSClient is available:
What's new:
1. Querying capability – We have included a functionality where you can write and execute queries against a container. Currently we have taken an easy way out and are displaying query results as sent by SDS (in XML format). In next version we will try and display it in a datagrid format. To invoke querying capability, either use Container context menu or Query icon in the entity panel.

2. 500+ entities – We have included this functionality where you can progressively get 500+ entities. It’s not an automated process but rather a manual process i.e. after 500 entities are displayed, then you have to click on "Get More Entities" button to get the next batch.

3. Grid View for Entities – This is another view for displaying entities in a container. Under grid view, you can group the entities by “Entity Kind” and sort your entities as well. To group the entities by Entity Kind, just drag the "Entity Kind" header and place it over the text which reads “Drag a column header and drop it here to group by that column”. To ungroup it, just drag the "Entity Kind" column from the top and place it back on the data grid.


Do try it out and let us know what you think. As always feedback & feature requests are much appreciated. Link is: http://omega.cerebrata.com/default.aspx?r=BLSP.

Thanks

Gaurav

Wednesday, February 4, 2009

A new version of Omega.SDSClient is available

We have released a new version of Omega.SDSClient. We have completely overhauled the user interface of Omega.SDSClient. In the new version, we have used a more developer friendly "tree view" layout where your authorities & containers are displayed in a tree view and the entities belonging in a container are displayed as tabbed item. Furthermore we have included the functionality where a user can temporarily hide authorities & containers from the plain view.
The new version is available at http://omega.cerebrata.com/default.aspx?r=BLSPand a user guide for the same is available at http://omega.cerebrata.com/Docs/Omega.SDSClient.UserGuide.pdf.

Thanks

Sunday, January 18, 2009

Omega.SDSClient now supports BLOB Entities

Today we released a new version of Omega.SDSClient. In this new version we have included support for BLOB entities. You can now create new BLOB entities, download & view BLOB content.

Screenshot below shows the new Entity Panel.



As you can see from picture above, there are now two icons: One to create Entity with Flexible properties (Flexible Entity) & other to create Entity with BLOB content (BLOB entity). Under the list of entities, we are now showing both the BLOB & Flexible entities. Just by looking at your entities list, there are 3 ways by which you can identify that one entity is a BLOB or Flexible entity:
1. There will be a "Star" icon in the entity display header.
2. You will see an icon to download/view in the entity display header.
3. For BLOB entities, kind will always be null (at least for now).

We have not changed the functionality of Flexible entities.

CREATE BLOB ENTITY

To create BLOB entity, click on the "New BLOB Entity" icon. Following form will be displayed:



Here are the steps to create a BLOB entity:

  1. Specify an ID for the entity or you can click on "Auto Generate Id" button to let the application generate one for you. When the application generates one, the Id will be in the form of GUID.
  2. Select a file. It can be any file. Currently through this application we are limiting a maximum of 10MB upload even though SDS supports each BLOB entity to be 100 MB in size. Application will show you the file size (in bytes) of the file being uploaded.
  3. Based on the file type (basically extension), we set the content type of the file. However you are free to change the content type. We have mapped common extensions to their mime types (e.g. gif files to image/gif etc.). Since we possibly can't map all kinds of file types, for those we have not mapped the content type will be application/octet-stream.
  4. Click on the "Save" button.

UPDATE BLOB ENTITY


Steps to update a BLOB entity are exactly same. Only difference being you can't edit the Id field.

DOWNLOAD/VIEW BLOB ENTITY

Viewing a BLOB entity is a two step process: First we download then Blob contents and then save it on the web server. Once the contents are saved on the web server, you can view the contents of the Blob Entity. To download / View Blob entity, click on the download/view icon. Following form will be displayed.




First click on the "Download" button to initiate download. Once the download is complete, "View" button will be enabled.





Click on the "View" button to view content.

Thursday, January 8, 2009

Announcing the launch of Omega.SDSClient

Yesterday we launched our second product, Omega.SDSClient – a browser based client for Microsoft SQL Data Service (part of Azure platform). I will not go into the details of SDS & Azure platform as there is plenty of information available and I am certainly not the most qualified to comment on these. I would rather talk about the product itself. It certainly had been an interesting experience while development of this product. I would like to share those here:

  • Omega.SDSClient is developed using Microsoft Silverlight & Windows Communication Foundation (WCF) technology. This was our first attempt at both of these technologies and I believe we have done a decent job at that. Essentially the team started with no knowledge on these two platforms and learned stuff as we were building this application.
  • Omega.SDSClient is developed completely by my team here in India and I think they have done a remarkable job considering their overall and lack of prior experience with the technology used to build this product.

Coming back to Omega.SDSClient, here is our basic premise about building this as a web based product: If your data is stored in cloud, why do you need to download/install any software to manage it? So it is a web based application built on Silverlight 2 and WCF and it lets you do the following with your SDS data repositories:

  • Manage Authorities
  • Manage Containers
  • Manage Entities

This is obviously the first version of the application and we hope to add more features to it. Currently we are planning to provide BLOB & Querying support in this product. Hopefully we should be out with our next version soon.

Please do check it out. The URL is http://omega.cerebrata.com/default.aspx?r=BLSP.

Drop me a line with your feedback.

I will keep you posted on the progress of the same.

Cheers!!!

Tuesday, December 2, 2008

Little tidbits about Silverlight 2.0

If you are developing a custom control in SL 2.0 and want to make your control through XAML Resource dictionary, remember to do two things:
1. The resource dictionary must be named "generic.xaml".
2. It should be placed in "Themes" directory.
You do that .... you are golden .....
Cheers !!!