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.
Unfortunately, activation email could not send to your email. Please try again.

Databound Grid column references

Thread ID:





3043 Feb 26,2003 09:19 PM Feb 27,2003 01:55 AM Windows Forms 2
Tags: GridControl
Asked On February 26, 2003 09:19 PM

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

Administrator [Syncfusion]
Replied On February 27, 2003 01:53 AM

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

Administrator [Syncfusion]
Replied On February 27, 2003 01:55 AM

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


This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.