Hi Telerik,
I have assigned some cols as read only in the radgrid(radform) and i used cell formatting to apply colors like this by name:
Then i want to hide/unhide based on the selection like this:
When i Click on Normal Mode function, it applies colors to other cols. This is really strange for me. Please help me, thank you.
I have assigned some cols as read only in the radgrid(radform) and i used cell formatting to apply colors like this by name:
DTURradGridView.Columns[
"dtuct0"
].ReadOnly =
true
;
DTURradGridView.Columns[
"dtuct1"
].ReadOnly =
true
;
DTURradGridView.Columns[
"dtuct2"
].ReadOnly =
true
;
DTURradGridView.Columns[
"dtuct3"
].ReadOnly =
true
;
DTURradGridView.Columns[
"dtuy"
].ReadOnly =
true
;
if
(e.CellElement.ColumnInfo
is
GridViewDataColumn)
{
if
(e.CellElement.ColumnInfo.FieldName ==
"dtuct0"
)
{
e.CellElement.DrawFill =
true
;
e.CellElement.NumberOfColors = 1;
e.CellElement.BackColor = Color.LightSlateGray;
e.CellElement.GradientStyle = GradientStyles.Linear;
}
if
(e.CellElement.ColumnInfo.FieldName ==
"dtuct1"
)
{
e.CellElement.DrawFill =
true
;
e.CellElement.NumberOfColors = 1;
e.CellElement.BackColor = Color.LightSlateGray;
e.CellElement.GradientStyle = GradientStyles.Linear;
}
if
(e.CellElement.ColumnInfo.FieldName ==
"dtuct2"
)
{
e.CellElement.DrawFill =
true
;
e.CellElement.NumberOfColors = 1;
e.CellElement.BackColor = Color.LightSlateGray;
e.CellElement.GradientStyle = GradientStyles.Linear;
}
if
(e.CellElement.ColumnInfo.FieldName ==
"dtuct3"
)
{
e.CellElement.DrawFill =
true
;
e.CellElement.NumberOfColors = 1;
e.CellElement.BackColor = Color.LightSlateGray;
e.CellElement.GradientStyle = GradientStyles.Linear;
}
if
(e.CellElement.ColumnInfo.FieldName ==
"dtuy"
)
{
e.CellElement.DrawFill =
true
;
e.CellElement.NumberOfColors = 1;
e.CellElement.BackColor = Color.LightSlateGray;
e.CellElement.GradientStyle = GradientStyles.Linear;
}
}
Then i want to hide/unhide based on the selection like this:
private
void
normalToolStripMenuItem_Click(
object
sender, EventArgs e)
//Normal View
{
DTURradGridView.Columns[
"dtuct0"
].IsVisible =
false
;
DTURradGridView.Columns[
"dtuct1"
].IsVisible =
false
;
DTURradGridView.Columns[
"dtuct2"
].IsVisible =
false
;
DTURradGridView.Columns[
"dtuct3"
].IsVisible =
false
;
DTURradGridView.Columns[
"dtuy"
].IsVisible =
false
;
}
private
void
advancedToolStripMenuItem_Click(
object
sender, EventArgs e)
//Advanced View
{
DTURradGridView.Columns[
"dtuct0"
].IsVisible =
true
;
DTURradGridView.Columns[
"dtuct1"
].IsVisible =
true
;
DTURradGridView.Columns[
"dtuct2"
].IsVisible =
true
;
DTURradGridView.Columns[
"dtuct3"
].IsVisible =
true
;
DTURradGridView.Columns[
"dtuy"
].IsVisible =
true
;
}