Click here to Skip to main content
15,899,679 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
I need to add checked cell value to Datatable.My code is below.But every time when I check cell it add only selected cell value.Currently selected.Not all selected cells values.May be problem in event(cell_change)?Help please.

C#
private void ultraGrid3_CellChange(object sender, CellEventArgs e)
{

DataTable dt = new DataTable();
dt.Columns.Add("Fields",typeof(String));
DataRow row = dt.NewRow();
row[0] =e.Cell.Row.Cells["Selected_Fields"].Value.ToString();
dt.Rows.Add(row);
return dt;

this.ultraGrid4.DataSource = dt;
}
Posted
Updated 2-Apr-13 23:04pm
v2
Comments
Motamas 21-Mar-13 4:30am    
I am not really understand what you trying to achieve. Do you need a simple column with checkbox? In this case the easiest way to use a boolean datatable column and the ultragrid will automatically set the columm's cell to checkbox. But as I see you habe to ultraGrid (3 and 4). So I am bit confused, please try to clarify in more detail.

1 solution

XML
Hello,
A possible approach to achieve this might be by using the following code:

<pre lang="vb">Private Sub UltraGrid1_InitializeLayout(ByVal sender As Object, ByVal e As Infragistics.Win.UltraWinGrid.InitializeLayoutEventArgs) Handles UltraGrid1.InitializeLayout
        &#39;e.Layout.Bands(0).Override.CellAppearance.BackColor = Color.Red
        Me.UltraGrid1.DisplayLayout.Bands(0).Columns(5).Style = Infragistics.Win.UltraWinGrid.ColumnStyle.CheckBox

    End Sub</pre>

if u need more help please visit the below link
http://ahmadkhalid44.blogspot.com/[^]
Regards:
Ahmad Khalid
Software Engineer
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900