The Syncfusion native Blazor components library offers 70+ UI and Data Viz web controls that are responsive and lightweight for building modern web apps.
.NET PDF framework is a high-performance and comprehensive library used to create, read, merge, split, secure, edit, view, and review PDF files in C#/VB.NET.
Hi.
I''ve looked through all of the posts on the GridListControl, and the examples, but cannot seem to get this to work.
I have a grid grouping control with a GridListControl cell. The grid list will display fine, but I cannot seem to get at the values of the the row that was selected. The DataRowView object that is returned always seems to be null.
Please see my event handler below, and see if you can see where I''m going wrong. Thanks.
private void gridGroupingControl1_TableControlCurrentCellCloseDropDown(object sender, GridTableControlPopupClosedEventArgs e)
{
GridCurrentCell cc = this.gridGroupingControl1.TableControl.CurrentCell;
GridDropDownGridListControlCellRenderer cr = cc.Renderer as GridDropDownGridListControlCellRenderer;
if (cr != null)
{
DataRowView drv = ((GridDropDownGridListControlPart)cr.ListControlPart).SelectedItem as DataRowView;
if (drv == null)
{
MessageBox.Show("DRV is null");
}
else
{
MessageBox.Show("DRV is not null");
}
}
}
ADAdministrator Syncfusion Team September 27, 2005 07:58 PM UTC
Here is a minimal sample showing this working using version 3.3.
http://www.syncfusion.com/Support/user/uploads/GGC_GLC_a847ab43.zip
Are you setting the Displaymember, ValueMember and DataSource properties?
RPRoss PrestmoSeptember 28, 2005 06:41 PM UTC
Clay,
Thanks for your help. My problem was that I was not setting the ValueMember property.
What I am actually trying to do is to populate multiple cells in the current row based on the selection from the GridListControl.
I''ve put the following code in the trigger that I pasted above, to try to do this, and it seems to work, except that the value doesn''t show up in the grid until I move to a different cell.
int i = this.gridGroupingControl1.TableControl.Model.NameToColIndex("REASONID"); this.gridGroupingControl1.TableControl.Model[cc.RowIndex,i].Text = drv[1].ToString();
I can get it to show up immediately if I call :
this.Validate();
... but I don''t know if that is the best way to acheive this.
If you could let me know if there is a better way, that would be great.
Thanks.
Ross.