Jiangcx
Jiangcx

Reputation: 3

whether devexpress GridControl Component can use the first column as index name

I'm new to Devexpress and windows desktop program,now I have to to dispaly the json data , below is the format

{
    "op": "etf_info"
    "data": {
            "up_l": 100,  
            "down_l": 100,  
            "halt": 100,
            "est_dif": 123,
            “create_iopv”: 1.5991,
            "create_limit": 100,
            "redeem_iopv": 1.6992, 
            "redeem_num": 200,
           }
}

and the name of each filed are required to be put at the first column, the next column display the data, because of the layout of components inside the mainform.

I'm trying GridControl but don't how to set it or whether it could word like that.

I do need your help~

Upvotes: 0

Views: 42

Answers (1)

Mohammed
Mohammed

Reputation: 1

you need to access gridview from gridcontrol like this:

GridView gridview = ((GridView) gridcontrol.FocusedView);

and use this loop

foreach (GridColumn item in gridView.Columns)  
{  
    if (item == gridView1.Columns["<SomeColumnName>"])  
    {  
          //............  
     }  
}

you can get more information in: https://supportcenter.devexpress.com/ticket/details/t247992/how-to-find-a-column-in-the-gridcontrol I hope you got help. Thank you.

Upvotes: 0

Related Questions