We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date

Databound Grid column references

Hi I have a databound grid which I am adding a total line to by entering formulas into a header row and passing to another gridcontrol. This works fine, the problem is that the number of columns is static and as a result it is difficult to create a formula as the column name could be called "Hours" but the formula is looking for "=SUM(C1:C10)" Does anyone know an easy way of getting column 10 and knowing this is column J for formula purposes. If not then I will have to create an array to handle this. Regards Mac

2 Replies

AD Administrator Syncfusion Team February 27, 2003 06:53 AM UTC

There is a static method in GridrangeInfo for this purpose. Try
string cellLabel = GridRangeInfo.GetAlphaLabel(colIndex) + GridRangeInfo.GetNumericLabel(rowIndex);

AD Administrator Syncfusion Team February 27, 2003 06:55 AM UTC

Also, there is a Binder method to get the colInex from the column name.
int colIndex = g.Binder.NameToColIndex("colName");

Live Chat Icon For mobile
Up arrow icon