Click here to Skip to main content
15,885,985 members
Please Sign up or sign in to vote.
2.33/5 (3 votes)
See more:
hi,

there are two columns in ultragrid.

first column style checkbox,second valuelist.

How to get second column value where first column is checked.
thanks
Posted
Comments
Richard MacCutchan 13-Mar-13 12:24pm    
[no name] 13-Mar-13 12:28pm    
Did you look at the documentation? http://help.infragistics.com/Help/NetAdvantage/WinForms/2011.2/CLR2.0/html/Infragistics2.Win.UltraWinGrid.v11.2~Infragistics.Win.UltraWinGrid.UltraGrid.html

1 solution

Hi,
you would use the ValueList to get the values from ultagrid.

C#
ValueList vl = ultraGrid.DisplayLayout.ValueLists["secondColumnName"];
var item = vl.ValueListItems[0];


If you are trying to get the value during an event such as "CellChanged" then use the event argument, such as:
C#
private void ultraGrid_CellChange(object sender, CellEventArgs e)
{
    if (e.Cell != null)
    {
    	if (e.Cell.Column.Key == firstColumnName)
    	{
            ValueList vl = ultraGrid.DisplayLayout.ValueLists["secondColumnName"];
            var item = vl.ValueListItems[0];
    	}
    }
}


I hope this helps.

Regards
Jegan
 
Share this answer
 
Comments
Daqdibi 13-Mar-13 16:29pm    
Hello Jegan.
I tried.But get error - Cannot find key -.I checked the key name.They are same.any idea?
Jegan Thiyagesan 14-Mar-13 4:59am    
As the keys are string, it might be spelled wrong or the columns has not given a key id.

Try a little test to check that all the columns has keys using this code below:

foreach(var column in ultraGrid.DisplayLayout.Bands[0].Columns)
{
Console.Out.WriteLine(column.Key);
}

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