Click here to Skip to main content
15,899,825 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I am reading the data from text file and binding it to SourceGrid. After viewing, the user has the right to copy and edit the cell.

Also, he has to select multiple rows and columns in the Sourcegrid.

What I have tried:

C#
private void Grid1_MouseClick(object sender, MouseEventArgs e)
{
    SourceGrid.Grid dg = (SourceGrid.Grid)sender;
    int c = dg.MouseCellPosition.Column;
    int r = dg.MouseCellPosition.Row;
    SourceGrid.CellContext cc = new SourceGrid.CellContext(dg, new SourceGrid.Position(r,c));

    try
    {
        if (cc.DisplayText != "")

            this.Grid1.GetCell(r, c).Editor.EnableEdit = true;
    }
    catch (Exception ex)
    {
        MessageBox.Show(ex.ToString());
    }
}
Posted
Updated 10-May-16 5:03am
v2
Comments
Sergey Alexandrovich Kryukov 10-May-16 11:00am    
"Winfor"?
Do you mean this: http://www.codeproject.com/Articles/3531/SourceGrid-Open-Source-C-Grid-Control?
If so, it would be better to ask the author of the article.
—SA
Sudheer gadde 12-May-16 2:49am    
Yeah Sergey. I am talking about the Private gird.. i.e. SourceGrid Control....

1 solution

I hardly can believe that this is something else but the open-source product described in the article referenced in my comment to the question, but next time please provide links to what you are talking about.

Then it would be better to do this: "SourceGrid — Open Source C# Grid Control": Add a Comment or Question — CodeProject.

When you add your question to the discussion, the author will get a notification and a chance to answer your questions.

—SA
 
Share this answer
 
v4
Comments
Sudheer gadde 12-May-16 2:51am    
Thanks a bunch Sergey...
Sergey Alexandrovich Kryukov 12-May-16 2:54am    
You are welcome.
—SA

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900