Skip to content

Replies

0
Geoffrey
Geoffrey answered on Feb 26, 2008 5:00 PM

I found the anwer …

.DisplayLayout.Bands(0).DataKeyField = "OrderId, ProductID"

would produce the desired two column key relationship in the webgrid.

 Dim key_row() As Object = e.Cell.Row.DataKey

table = dsList.Tables(e.Cell.Band.BaseTableName)

row = table.Rows.Find(key_row)

would allow you to find the key.

0
Geoffrey
Geoffrey answered on Feb 26, 2008 4:11 PM

I am binding a webgrid to a sharepoint datatable and allowing the user to update a document list via the webgrid.

Let us consider the following example code:

tbl = ds.Tables.Add("Order Details");
tbl.Columns.Add("OrderID", typeof(int));
tbl.Columns.Add("ProductID", typeof(int));
tbl.PrimaryKey = new DataColumn[ {tbl.Columns["OrderID"],
                                   tbl.Columns["ProductID"]}; 

… is this supported in the ultrawebgrid?

I have reviewed source samples eg. UltraWebGrid1.Bands[0].DataKeyField=dataSet11.Tables[ParentTable].PrimaryKey[0].ColumnName;

this example does not provide for multiple keys .. any thoughts?

tia.