Hello,
There are two ultragrids.I need selected rows from first grid to add second grid.Row by row.To set every row cells different editor controls.
Please, help
Could you please review the sample attached to this post and see if it meets your requirements. Please feel free to let me know if I misunderstood you or if you have any other questions.
Hello Borisov.Thanks a lot.I have another question , too.When I load ultragrid the checkbox column default state is checked.How to set it unchecked?Default state.
Ilkin,
How are you getting the value of the cell? Is it from the .Value property? It does not update, because by default the 'WinGrid' updates the value when you exit editmode, but when clicking on the checkbox you are still in editmode. So my suggestion is to use the .Text property of the cell in order to get the right value.
Please let me know if this helps.
Boris ,
My code is below :
foreach (UltraGridRow row_1 in ultraGrid3.Rows) { if ((bool)row_1.GetCellBoolValue("Sec") == true) { DataRow row = dt_2.NewRow(); row[0] = row_1.Cells["Suallar"].Text; row[10] = row_1.Cells["Table_Name"].Text; dt_2.Rows.Add(row);
}
The problem here is probably GetCellBoolValue. There is no such method on the UltraGridRow, so I assume that's an extender method? Anyway, you are probably accessing the Value property of the cell, which won't be updated until the user leaves the cell. Instead of using Value, use Text property of the grid cell and use bool.Parse to convert that text into a boolean for a checkbox column.
Hello Mike Saltzman.
Thanks .I have another question.How to make ultragrid checkbox column default state unchecked?When it loads checkbox column state is checked.
Thanks in advance.
Hi,
There is no "default". The value of the checkbox comes from the value of the field in the data source, assuming the column is bound. So your data source needs to return false in every cell for the column.
If it's an unbound column, then the default is unchecked. If it's showing up checked, then something in your code must be setting the value of the cells in the unbound column to true.