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. (Last updated on : Nov 16th 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Verify the column value in all Rows

Thread ID:

Created:

Updated:

Platform:

Replies:

117600 Nov 14,2014 07:01 AM UTC Nov 25,2014 01:52 AM UTC WinForms 3
loading
Tags: GridControl
Srinivasan
Asked On November 14, 2014 07:01 AM UTC

Team,
 
We are doing test automation for an application using syncfusion grid.. We have access to grid object.. we need to verify a whether same value is there in a column of a grid.. Is there anyway to do that ? I think iterating through all rows and verifying is not a good idea.
 
Kindly help us
 
Regards,
Srini

Muthukumar Kalyanasundaram [Syncfusion]
Replied On November 17, 2014 12:47 PM UTC

Hi Srinivasan,

 

Thank you for your interest in Syncfusion product.

 

If you want to verify the same value is there in a column of all rows in a grid. We have customized the sample as per your need. Please refer the below attached sample.

 

Regards,

Muthukumar K


Attachment: Sample_d82e2336.zip

Srinivasan
Replied On November 18, 2014 04:58 AM UTC

Thank you Muthu kumar for your reply..
 
My requirement to identify whether same value is there  in entire column ... So most common approach would be to iterate
 
text="110"
columnIndex=3;
for(i=0;i<rowcount;i++){
if(!(grid.get_Item(i,columnIndex)==text))
Log.Error("Invalid value in column")
}
 
The above code will work , but its inefficient code... As we have to iterate through all rows and it will be perfomance hit if we more number of rows ...
 
So my real question is
 
1) Is there any method in sync fusion grid object , that will give all cell values(in all rows) of a column seperated by delimiter...? If not pls suggest me efficient way to get all column values..
 
2) Is there any method in syncfusion grid object, that give all column values of a row seperated by delimitter?... if not pls suggest me efficient way ?
 
Regards,
Srini
 
 

Muthukumar Kalyanasundaram [Syncfusion]
Replied On November 25, 2014 01:52 AM UTC

Hi Sirnivasan,

 

Sorry for the delay in response.

 

If you want to identify whether the same value is occurred on particular column (column as 3) or not, you can use the “Contains” method. And also if you want to separate the delimiter in the grid cellvalue, you can use “Replace” method. Please refer the below code,

 

Code:

      string myArray;

        private void button1_Click(object sender, EventArgs e)

        {          

            if (checkBox1.CheckState == CheckState.Checked)

            {

                string s = cmbSearch.Text;

                myArray = s.Replace(",", "").Replace(".","").Replace(" ","");             

                highlighttext.HighlightText = myArray.ToString();

                this.gridControl1.Refresh();

            }

            for (int k = 1; k < this.gridControl1.RowCount; k++)

            {

                if (this.gridControl1[k, 2].Text.Contains(myArray))

                {

                    this.gridControl1[k, 2].BackColor = Color.DeepSkyBlue; 

                }

                else

                {

                    this.gridControl1[k, 2].BackColor = Color.White;

                }

            }          

        }

 

Please let us know if I misunderstood your query.

 

Regards,

Muthukumar K


Attachment: Sample_a7702418.zip

CONFIRMATION

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.

Warning Icon 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.Close Icon

;