Software Technology Tips

If you have used the DevExpress GridView, during Windows Application development, you are likely to have come across a column with a ColumnEdit of type "HyperLinkEdit". If you want to set the RepositoryItem for that column during runtime according to the value of another column then you have to handle the GridView's CustomRowCellEdit event.
 
Refer the following code :
 private void gridview1_CustomRowCellEdit(object sender, CustomRowCellEditEventArgs e)
        {
            if (e.Column == gcHypLinkColumn)
            {
   if (gridview1.GetRowCellValue(e.RowHandle,      gcLocked).ToString().CompareTo("Unlocked") == 0)
                {
                    e.RepositoryItem = repHypLink;
                }
                else
                {
                    e.RepositoryItem = null;
                }
            }
        }
 
HyperLinkEdit has been used in the above code as an example only, depending on your need  you can use any other type of Repository availabe. 


Related Tags:

ASP.NET, DBExpress GridView

Author: Rashmita Devi

ASP.NET

Let us Connect!

privacy
iso 9001 QA25 Nasscom Red Herring zinnov STPI iso 27001

copyright (c) Mindfire Solutions 2007-2013. Login