Strange behavior in accessing columns in Telerik gridview

Posted by gdb390 on 21-Aug-2015 05:24

Hey,

OpenEdge 11.5 & Telerik Winform Controls 2015.2.623.40

I have a radgrid on a form with a bindingsource that is connected to the top-nav-query of a dataset . 

I want to access the two columns (ttCustnum and ttCustname) through code.

I am able to use the following code --> syntax correct 

radGridView1:Columns["ttCustNum"]:HeaderText = "Custnum".


If I want to use the gridviewcollection , I get syntax errors on the last line...

define var gridColumns as Telerik.WinControls.UI.GridViewColumnCollection no-undo.
    
    assign gridColumns = radGridView1:Columns.
    
    gridColumns["ttCustNum"]:HeaderText = "Num".


Am I doing something wrong ? 

Posted by Laura Stern on 25-Aug-2015 15:51

Why are you saying that?  This is not a generic collection.  You can tell by its name if its generic, e.g. this would be generic:

  Telerik.WinControls.UI.GridViewColumnCollection<T>  (where T is the type of element in the collection)

But it looks like you have a way to do this. Use one of the variations that work!  

And you should log a bug for what doesn't work.

All Replies

Posted by Laura Stern on 21-Aug-2015 07:18

That makes no sense to me.  It looks like you're doing it right.  If the first way compiles, so should the second.

Does it work if you pull it apart even more?  I.e, define a var as a column object and do;

 gridColumn = gridColumns["ttCustNum"].

Does it work if you reference it as an Item property, I.e,

 gridColumns:item["ttCustNum"]:HeaderText = "Num".

Posted by gdb390 on 25-Aug-2015 15:17

Sorry I didn't answer earlier ... I was @ customer's site

I attached the code with your suggestions and the lines with the red dot don't compile

Posted by gdb390 on 25-Aug-2015 15:20

is it because the collection is a generic collection ?

Posted by Laura Stern on 25-Aug-2015 15:51

Why are you saying that?  This is not a generic collection.  You can tell by its name if its generic, e.g. this would be generic:

  Telerik.WinControls.UI.GridViewColumnCollection<T>  (where T is the type of element in the collection)

But it looks like you have a way to do this. Use one of the variations that work!  

And you should log a bug for what doesn't work.

Posted by gdb390 on 02-Sep-2015 04:53

Logged the issue @ TS and they could reporduce the error -  below the answer

I reproduced the issue and have logged bug# PSC00339845. Development will handle the issue from here onward and will aim to address it in a future release.

For your reference, I also double-checked in VB.NET and confirmed that the equivalent code works fine, so it is something on the ABL side rather than with the radGridView control. Fortunately, specifying the Item property (e.g. gridColumns:ITEM["ttCustName"]:HeaderText) is sufficient to avoid the problem.

This thread is closed