I am converting Infragistics 2010 v2 CLR3.5 to Infragistics 2014 v2 using 4.5 CLR using Visual Studio 2013 Professional Update 4. I am getting following error while building the project. Please reply immediately..........
Error 197 'Infragistics.Web.UI.GridControls.GridRecord' does not contain a definition for 'BandIndex' and no extension method 'BandIndex' accepting a first argument of type 'Infragistics.Web.UI.GridControls.GridRecord' could be found (are you missing a using directive or an assembly reference?)
Below error is there while fixing the code:
if (e.Row.DataChanged.ToString() != "Added" && Update == "Y") { foreach (DataRow modDR in dt.Rows) { int rowID = e.Row.BandIndex; if ((modDR[totalCol - 1].ToString() == rowID.ToString() && e.Row.DataChanged.ToString() != "Deleted") || (Int32.Parse(modDR[totalCol - 1].ToString()) == e.Row.Band.Grid.Rows.Count && !rowexists)) { dr = modDR; rowexists = true; } }
}
Hello Jack,
Row.BandIndex was removed. You can get the "rowID" by e.RowID:
protected void WebHierarchicalDataGrid1_RowUpdated(object sender, RowUpdatedEventArgs e)
{ var rowId = e.RowID;}
Let me know if I can be of further assistance.
I'm just following up to see if you need any further assistance with this issue. If so please let me know
The reply you gave does not apply to me. I checked from my end the solution you gave, it is not related what I need. I am pasting the code again. Please let me know the fix of "BandIndex" as current is showing as "Infragistics.Web.UI.GridControls.GridRecord" does not contain a definition for "BandIndex"-----------Please reply with alternative keeping in mind of below code........
private void StoreGridChanges(int totalCol, string gridID, Infragistics.Web.UI.GridControls.GridRecord e, DataTable dt) { try { int rowID = e.BandIndex; //here the above message is coming as GridRecord does not contain Definition for BandIndex DataRow dr = dt.NewRow(); bool rowexists = false; foreach (DataRow modDR in dt.Rows) // check if row already exists, if exists assign that to dr. { if (modDR[totalCol].ToString() == rowID.ToString()) { dr = modDR; rowexists = true; } }
The WebDataGrid behaves differently from UltraWebGrid and you won't be able to replicate the same logic here. You will have to change your code and use the instruments provided by the WebDataGrid.
The WebDataGrid has separate events for RowAdding/ed, RowDeleting/ed, RowUpdating/ed.You will have to first enable these behaviors in your code like this:
<Behaviors> <ig:EditingCore> <Behaviors> <ig:RowEditing></ig:RowEditing> <ig:RowAdding></ig:RowAdding> </Behaviors> </ig:EditingCore></Behaviors>
Then you will have to bind to the appropriate event (e.g. RowAdded) and use the provided parameters "sender" and "EventArgs". The sender is the grid itself and to access its properties it should be casted to ContainerGrid. And the EventArgs have information about the action you have executed:
protected void WebHierarchicalDataGrid1_RowAdded(object sender, RowAddedEventArgs e)
{ var grid = (sender as ContainerGrid); var rowId = e.RowID;}
I hope that helps. Let me know if I can be of further assistance.