
In my previous post, I mentioned how to get the selected ID of a gridview’s row when you click the row. Since then I have found that sometimes SalesLogix will implement an extra DataKey in the grid when it is deployed as a quick form. (For instance, if you specify the grid’s DataKeyNames = “Id”, when it deploys you will actually see the grids DataKeyNames are “InstanceId, Id” When you call the code I had mentioned before:
string noteId = grdSystemNotes.SelectedDataKey.Value.ToString();
The system would actually return the InstanceId DataKey since that is the first specified. The InstanceId is a GUID based Id for the rendered HTML grid and does no good for us wanting to get the row’s ID. The more sure-fire way of getting our desired DataKey “Id” is by using code like this:
string noteId = grdSystemNotes.DataKeys[grdSystemNotes.SelectedIndex].Values["Id"].ToString();
thanks this help me not to create customize smartpart.
This post changed my life. Well, at least it changed my day. Thanks.