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.
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

non editable grid grouping control

Thread ID:

Created:

Updated:

Platform:

Replies:

68173 Sep 11,2007 11:19 AM UTC Aug 22,2018 10:26 AM UTC Windows Forms 5
loading
Tags: Grouping
prabhjeet
Asked On September 11, 2007 11:19 AM UTC

I am using syncfusion grid grouping control.
The following code make the cell non editable of grid grouping control...but the focus of cursor is still there...no doubt that i cannot edit the cell but i don't want that cursor should be there..


following code make cell non editable but does not remove cursor focus from the cell..

private void ggcMapDetails_QueryCellStyleInfo(object sender, GridTableCellStyleInfoEventArgs e)
{
Element el = e.TableCellIdentity.DisplayElement;
if (el.Kind == DisplayElementKind.Record && e.TableCellIdentity.Column != null &&
(e.TableCellIdentity.Column.Name == "Type" || e.TableCellIdentity.Column.Name == "Enabled"))
{
e.Style.ReadOnly = false;
e.Style.BackColor = Color.AliceBlue;
}
else
{
e.Style.ReadOnly = true;
}

}



J.Nagarajan [Syncfusion]
Replied On September 11, 2007 06:24 PM UTC

Hi Prabhjeet,

Thanks for your continued interest in SYncfusion product. To avoid the cursor inside the cell you have to handle TableControlCurrentCellStartEditing event . Please refer to the following code snippet

void gridGroupingControl1_QueryCellStyleInfo(object sender, Syncfusion.Windows.Forms.Grid.Grouping.GridTableCellStyleInfoEventArgs e)
{
Syncfusion.Grouping.Element el = e.TableCellIdentity.DisplayElement;
if (el.Kind == Syncfusion.Grouping.DisplayElementKind.Record && e.TableCellIdentity.Column != null &&
(e.TableCellIdentity.Column.Name == "Type" || e.TableCellIdentity.Column.Name == "Enabled"))
{
e.Style.ReadOnly = false;
e.Style.BackColor = Color.AliceBlue;
}
else
{
e.Style.ReadOnly = true;
}

}

void gridGroupingControl1_TableControlCurrentCellStartEditing(object sender, GridTableControlCancelEventArgs e)
{
e.Inner.Cancel = true;
}


I have attached the sample that demonstrates this completely. You can download the sample from the following page.

http://websamples.syncfusion.com/samples/Grid.Windows/F68173/main.htm

Please refer to the sample and let me know if you have any questions.

Regards,
Nagaraj

abc
Replied On September 12, 2007 05:39 AM UTC

thx a lot Nagarajan for a quck reply,

using this code will dissable cursor on all column cells...but in my application some columns are editable and some not. can u pls help me in this.

Thanks & Regards
Prabhjeet

>Hi Prabhjeet,

Thanks for your continued interest in SYncfusion product. To avoid the cursor inside the cell you have to handle TableControlCurrentCellStartEditing event . Please refer to the following code snippet

void gridGroupingControl1_QueryCellStyleInfo(object sender, Syncfusion.Windows.Forms.Grid.Grouping.GridTableCellStyleInfoEventArgs e)
{
Syncfusion.Grouping.Element el = e.TableCellIdentity.DisplayElement;
if (el.Kind == Syncfusion.Grouping.DisplayElementKind.Record && e.TableCellIdentity.Column != null &&
(e.TableCellIdentity.Column.Name == "Type" || e.TableCellIdentity.Column.Name == "Enabled"))
{
e.Style.ReadOnly = false;
e.Style.BackColor = Color.AliceBlue;
}
else
{
e.Style.ReadOnly = true;
}

}

void gridGroupingControl1_TableControlCurrentCellStartEditing(object sender, GridTableControlCancelEventArgs e)
{
e.Inner.Cancel = true;
}


I have attached the sample that demonstrates this completely. You can download the sample from the following page.

http://websamples.syncfusion.com/samples/Grid.Windows/F68173/main.htm

Please refer to the sample and let me know if you have any questions.

Regards,
Nagaraj

J.Nagarajan [Syncfusion]
Replied On September 13, 2007 03:21 AM UTC

Hi Prabhjeet,

You can disable the cursor for a particular column. To achieve this you have to handle TableControlCurrentCellStartEditing. In this event you can check the particular column name to disable the cursor. Please refer to the following code snippet

[C#]
void gridGroupingControl1_TableControlCurrentCellStartEditing(object sender, GridTableControlCancelEventArgs e)
{
GridCurrentCell cc = e.TableControl.CurrentCell;
GridTableCellStyleInfo style = (GridTableCellStyleInfo)e.TableControl.GetTableViewStyleInfo(cc.RowIndex, cc.ColIndex);
if (style.TableCellIdentity.DisplayElement.Kind == DisplayElementKind.Record && style.TableCellIdentity.Column.Name == "Col1")
e.Inner.Cancel = true;
}

Please refer to the attached sample that demonstrates this. In this sample the editable cursor is disabled for Column1.

http://websamples.syncfusion.com/samples/Grid.Windows/F68173Sep12/main.htm


Please refer to it and let me know if this helps.
Regards,
Nagaraj

Nagaraju Dhulipalla
Replied On August 21, 2018 07:10 AM UTC

Hi Prabhjeet,

You can disable the cursor for a particular column. To achieve this you have to handle TableControlCurrentCellStartEditing. In this event you can check the particular column name to disable the cursor. Please refer to the following code snippet

[C#]
void gridGroupingControl1_TableControlCurrentCellStartEditing(object sender, GridTableControlCancelEventArgs e)
{
GridCurrentCell cc = e.TableControl.CurrentCell;
GridTableCellStyleInfo style = (GridTableCellStyleInfo)e.TableControl.GetTableViewStyleInfo(cc.RowIndex, cc.ColIndex);
if (style.TableCellIdentity.DisplayElement.Kind == DisplayElementKind.Record && style.TableCellIdentity.Column.Name == "Col1")
e.Inner.Cancel = true;
}

Please refer to the attached sample that demonstrates this. In this sample the editable cursor is disabled for Column1.

http://websamples.syncfusion.com/samples/Grid.Windows/F68173Sep12/main.htm


Please refer to it and let me know if this helps.
Regards,
Nagaraj

The following code snippet is not working for me


You can disable the cursor for a particular column. To achieve this you have to handle TableControlCurrentCellStartEditing. In this event you can check the particular column name to disable the cursor. Please refer to the following code snippet


[C#]
void gridGroupingControl1_TableControlCurrentCellStartEditing(object sender, GridTableControlCancelEventArgs e)
{
GridCurrentCell cc = e.TableControl.CurrentCell;
GridTableCellStyleInfo style = (GridTableCellStyleInfo)e.TableControl.GetTableViewStyleInfo(cc.RowIndex, cc.ColIndex);
if (style.TableCellIdentity.DisplayElement.Kind == DisplayElementKind.Record && style.TableCellIdentity.Column.Name == "Col1")
e.Inner.Cancel = true;
}

Please refer to the attached sample that demonstrates this. In this sample the editable cursor is disabled for Column1.

http://websamples.syncfusion.com/samples/Grid.Windows/F68173Sep12/main.htm

Arulraj A [Syncfusion]
Replied On August 22, 2018 10:26 AM UTC

Hi Nagaraju, 
 
Thanks for using Syncfusion product. 
 
We have tried to reproduce your scenario using the following sample. But, the sample is working fine as expected. So, please provide the following details to reproduce the reported scenario, 

  • Let us know the TableControlCurrentCellStartEditing event has triggered or not when you click on the cell. If the event has not triggered, please check whether that event has hooked or not.
  • Please provide the Syncfusion version details which you are using currently.
  • Please let us know the below attached sample differ from your customization.

The above details will be helpful to reproduce the reported scenario and it will be helpful to provide the solution at the earliest. 


Arulraj A 


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

;