Forum Discussion

vjjohnson04's avatar
vjjohnson04
Occasional Contributor
13 years ago

Need help in getting cell value from radgridview

Hi,


I got the count of rows in the datagrid but now want to get the value for each cell corresponding to its count.




Thanks in advance


 

7 Replies

  • vjjohnson04's avatar
    vjjohnson04
    Occasional Contributor

    I tried the above methods and the wvalue(row,column) but it doesnt seem to work for me.



    Code:


    'comment: Here i get the count


    set Obj = Aliases.EFLT_EO_UI.HwndSource_MainView.MainView.Grid.mainTabControl.FeatureView.LayoutRoot.ResidenceSearchView.Grid


    Count = Obj.WPFObject("advanceResultRadGridView").Items.Count  


    now from i want the cell value from "advanceResultRadGridView" grid for eg:1st row 2nd column.



     

  • vjjohnson04's avatar
    vjjohnson04
    Occasional Contributor

    som additional info:


    this is the mapped name:


    Aliases.EFLT_EO_UI.HwndSource_MainView.MainView.Grid.mainTabControl.FeatureView.LayoutRoot.ResidenceSearchView.Grid.advanceResultRadGridView.GridViewRow.GridViewCell



    clrfullcalssname: Telerik.Windows.Controls.GridView.GridViewCell

  • irina_lukina's avatar
    irina_lukina
    Super Contributor

    Hi Vikas,


    I used the Telerik.WinControls.UI.RadGridView control and failed to reproduce the behavior you had described. I managed to obtain the cell values using the following code:



    Sys.Process("TelerikExamples").WinFormsObject("radGridView1").wValue(1, "Column_name")


    If this approach doesn't work for your application, I recommend that you contact our Support Team and send them the sample application with the mentioned grid control so that they could reproduce the behavior.


    Thanks.

  • vjjohnson04's avatar
    vjjohnson04
    Occasional Contributor

    hi i tried this but it doesnt seem to work. 


    if u could try using the wpf application orders loacated in the test complete sample applications section. showing me how to get the value from a particular cell it would be appreciated.


    Thanks in advance for your support. 

  • irina_lukina's avatar
    irina_lukina
    Super Contributor

    Hi Vikas,


    You can use the following code:



    Sys.Process("Orders").WPFObject("HwndSource: MainForm").WPFObject("MainForm").WPFObject("gridMain").WPFObject("OrdersView").Items.Item(2).Card


    Here, the index in the Item(Index) method specifies the row number, the Card parameter is the name of the needed column. So, in general, you need to use the following syntax:



    Sys.Process("Orders").WPFObject("HwndSource: MainForm").WPFObject("MainForm").WPFObject("gridMain").WPFObject("OrdersView").Items.Item(Row_number).Column_Name


    Does this help?

  • vjjohnson04's avatar
    vjjohnson04
    Occasional Contributor

    Thanks a lot this did help me a lot :-)



    this the code i actually used..


    Code:


    row_count = Sys.Process("EFLT.EO.UI").WPFObject("HwndSource: MainView", "Elektra - QA").WPFObject("MainView", "Elektra - QA", 1).WPFObject("Grid", "", 1).WPFObject("mainTabControl").WPFObject("FeatureView", "", 1).WPFObject("LayoutRoot").WPFObject("ResidenceSearchView", "", 1).WPFObject("Grid", "", 1).WPFObject("advanceResultRadGridView").items.Item(i).SupplierName