01.
public
class
MyGridBehavior : BaseGridBehavior
02.
{
03.
04.
05.
public
void
SelectCellBlock(GridViewCellInfo SelectedCellTopLeft,GridViewCellInfo SelectedNewCell)
06.
{
07.
this
.GridControl.ClearSelection();
08.
09.
10.
int
TopRowIndex = SelectedCellTopLeft.RowInfo.Index <= SelectedNewCell.RowInfo.Index ? SelectedCellTopLeft.RowInfo.Index : SelectedNewCell.RowInfo.Index;
11.
int
BottomRowIndex = SelectedCellTopLeft.RowInfo.Index >= SelectedNewCell.RowInfo.Index ? SelectedCellTopLeft.RowInfo.Index : SelectedNewCell.RowInfo.Index;
12.
13.
int
LeftColumnIndex = SelectedCellTopLeft.ColumnInfo.Index <= SelectedNewCell.ColumnInfo.Index ? SelectedCellTopLeft.ColumnInfo.Index : SelectedNewCell.ColumnInfo.Index;
14.
int
RightColumnIndex = SelectedCellTopLeft.ColumnInfo.Index >= SelectedNewCell.ColumnInfo.Index ? SelectedCellTopLeft.ColumnInfo.Index : SelectedNewCell.ColumnInfo.Index;
15.
16.
//this.GridControl.GridNavigator.BeginSelection(new GridNavigationContext() { InputType = InputType.Keyboard, ModifierKeys = Keys.Shift });
17.
18.
for
(
int
rowIndex = TopRowIndex; rowIndex <= BottomRowIndex; rowIndex++)
19.
{
20.
for
(
int
columnIndex = LeftColumnIndex; columnIndex <= RightColumnIndex; columnIndex++)
21.
{
22.
this
.GridControl.Rows[rowIndex].Cells[columnIndex].IsSelected =
true
;
23.
}
24.
}
25.
}
26.
27.
public
override
bool
ProcessKey(KeyEventArgs keys)
28.
{
29.
30.
if
(keys.Shift && keys.KeyCode ==Keys.Down)
31.
{
32.
GridViewCellInfo SelectedCellTopLeft =
this
.GridControl.SelectedCells.OrderBy(r => r.RowInfo.Index).ThenBy(c => c.ColumnInfo.Index).FirstOrDefault();
33.
this
.GridControl.GridNavigator.SelectNextRow(1);
34.
GridViewCellInfo SelectedNewCell =
this
.GridControl.SelectedCells.OrderBy(r => r.RowInfo.Index).ThenBy(c => c.ColumnInfo.Index).FirstOrDefault();
35.
SelectCellBlock(SelectedCellTopLeft, SelectedNewCell);
36.
return
false
;
37.
38.
}
39.
40.
if
(keys.Shift && keys.KeyCode == Keys.Up)
41.
{
42.
GridViewCellInfo SelectedCellTopLeft =
this
.GridControl.SelectedCells.OrderBy(r => r.RowInfo.Index).ThenBy(c => c.ColumnInfo.Index).FirstOrDefault();
43.
this
.GridControl.GridNavigator.SelectPreviousRow(1);
44.
GridViewCellInfo SelectedNewCell =
this
.GridControl.SelectedCells.OrderBy(r => r.RowInfo.Index).ThenBy(c => c.ColumnInfo.Index).FirstOrDefault();
45.
SelectCellBlock(SelectedCellTopLeft, SelectedNewCell);
46.
return
false
;
47.
48.
}
49.
50.
if
(keys.Shift && keys.KeyCode == Keys.Left)
51.
{
52.
GridViewCellInfo SelectedCellTopLeft =
this
.GridControl.SelectedCells.OrderBy(r => r.RowInfo.Index).ThenBy(c => c.ColumnInfo.Index).FirstOrDefault();
53.
this
.GridControl.GridNavigator.SelectPreviousColumn();
54.
GridViewCellInfo SelectedNewCell =
this
.GridControl.SelectedCells.OrderBy(r => r.RowInfo.Index).ThenBy(c => c.ColumnInfo.Index).FirstOrDefault();
55.
SelectCellBlock(SelectedCellTopLeft, SelectedNewCell);
56.
return
false
;
57.
}
58.
59.
if
(keys.Shift && keys.KeyCode == Keys.Right)
60.
{
61.
GridViewCellInfo SelectedCellTopLeft =
this
.GridControl.SelectedCells.OrderBy(r => r.RowInfo.Index).ThenBy(c => c.ColumnInfo.Index).FirstOrDefault();
62.
this
.GridControl.GridNavigator.SelectNextColumn();
63.
GridViewCellInfo SelectedNewCell =
this
.GridControl.SelectedCells.OrderBy(r => r.RowInfo.Index).ThenBy(c => c.ColumnInfo.Index).FirstOrDefault();
64.
SelectCellBlock(SelectedCellTopLeft, SelectedNewCell);
65.
return
false
;
66.
}
67.
}
68.
}
Hello all telerik users,
I'm a new user of Telerik Objects and I have a problem where using a RadDropDownListItem in RadRibbonBarGroup.
In this case (Design form) the datasource property of the RadDropDownListItems is disabled. I don't understand. When I put a RadDropDownListItem elsewhere in the form this property is enabled. And of course I need it would be enabled inside a RadRibbonBarGroup.
I have to say that I'm not a C# or VB user but a Progress OpenEdgeStudio user.
Thanks a lot for your answers.
JP CLARY
Hi,
I am Using Gridview. I am adding the new row in the Grid and Some Rows added Already.How do set Defualt values to Newly Added Row.
Hi , I am using GridviewRelation to show the tree, but my data need to be shown like this:
Id ParentId
1 2
2 4
1 6
It means, sometimes we have the one child belong to many parents. It displays the below error, how can i fix it ?
Row with id '30' already appears in the hierarchy with parent id '27'. Each row in a self-reference hierarchy can appear only once in the hierarchy
hello everyone.i am trying create a half donut chart in my project.it has small area to dock as fill.
my problem is when i create a half donut rad chartview that view become so small.
it is look like this picture 1.There is many empty white area being and view size of charview is too much small.
but i want to make it view like at picture 2.
is that possible to create a half donut charview with bigger view size?if it is , how i can do that?I have already try change margin padding as 1px.
(this code: chart_PrimUretimi.Margin = new System.Windows.Forms.Padding(1); ) that doesn't help.
Morning,
I'm trying to embed a form that has a RadDock into my main application RadDock. The idea is that an end user would search for a project and the project would be loaded into the main forms RadDock (rdkMain). This would allow for more than one project to be shown at any given time. The project form could have multiple vendors which each would be loaded into the project RadDock(rdkProject). I understand that windows will only allow for a single form to be set to IsMdiContainer. Is there any way of doing this?
Thanks,
James