Posted
over 9 years
ago
by
poohwen
If I did not set cell like "new SourceGrid.Cells.Cell((""), typeof(string));", then the cell will not draw lines around the cell?
How to draw lines around the cell?
|
Posted
over 9 years
ago
by
poohwen
If I have 500 rows in the grid, i want to move to the row no. 100 and show row no. 100 in the middle of grid(screen)?
|
Posted
over 9 years
ago
by
poohwen
If I have 500 rows in the grid, i want to move to the row no. 100 and show row no. 100 in the middle of grid(screen)?
|
Posted
almost 10 years
ago
by
SoundOfMind
Zemira,
Thanks for getting me started on resolving this issue. I understand how the Button.OnClick event works, but the CheckBox.CheckedChanged event does seem awkward. My solution was to modify the CheckBox.cs file as follows:
Added:
///
... [More]
<summary>
/// An event MORE similar to Windows.Forms.CheckBox.CheckedChanged.
/// Handled just like Button.OnClick, with sender argument containing CellContext
/// Fired when value changed
/// </summary>
public event EventHandler CheckedChangedSenderCellContext;
protected virtual void OnCheckedChangedSenderCellContext(object sender, EventArgs e)
{
if (CheckedChangedSenderCellContext != null)
{
CheckedChangedSenderCellContext(sender, e);
}
}
Added the SECOND line shown (below existing line) in UIChangeChecked:
OnCheckedChanged(EventArgs.Empty);
OnCheckedChangedSenderCellContext(sender, e);
Shown below is the modified frmSample03.cs. First is from the OnLoad handler:
//Boolean (CheckBox)
grid[currentRow, 0] = new SourceGrid.Cells.Cell("Boolean (CheckBox)");
grid[currentRow, 0].View = captionModel;
grid[currentRow, 1] = new SourceGrid.Cells.CheckBox(null, true);
SourceGrid.Cells.Controllers.CheckBox checkBoxClickEvent = new SourceGrid.Cells.Controllers.CheckBox();
checkBoxClickEvent.CheckedChangedSenderCellContext += new EventHandler(InvertDisabledCheckBox);
grid[currentRow, 1].Controller.RemoveController(grid[currentRow, 1].FindController<SourceGrid.Cells.Controllers.CheckBox>());
grid[currentRow, 1].Controller.AddController(checkBoxClickEvent);
And last, the new InvertDisabledCheckBox:
private void InvertDisabledCheckBox(object sender, EventArgs e)
{
SourceGrid.CellContext context = (SourceGrid.CellContext)sender;
SourceGrid.Grid g = (SourceGrid.Grid)context.Grid;
if (g != grid)
return;
int row = context.Position.Row;
int col = context.Position.Column;
grid[row, 2].Value = !(((bool)grid[row, 2].Value));
}
Note that InvertDisabledCheckBox verifies that the grid in the context is the one you want. This allows use of multiple grids.
I plan on submitting these changes to the project.
Cal
[Less]
|
Posted
almost 10 years
ago
by
SoundOfMind
Zemira,
Thanks for getting me started on resolving this issue. I understand how the Button.OnClick event works, but the CheckBox.CheckedChanged event does seem awkward. My solution was to modify the CheckBox.cs file as follows:
Added:
///
///
... [More]
An event MORE similar to Windows.Forms.CheckBox.CheckedChanged.
/// Handled just like Button.OnClick, with sender argument containing CellContext
/// Fired when value changed
///
public event EventHandler CheckedChangedSenderCellContext;
protected virtual void OnCheckedChangedSenderCellContext(object sender, EventArgs e)
{
if (CheckedChangedSenderCellContext != null)
{
CheckedChangedSenderCellContext(sender, e);
}
}
Added the SECOND line shown (below existing line) in UIChangeChecked:
OnCheckedChanged(EventArgs.Empty);
OnCheckedChangedSenderCellContext(sender, e);
Shown below is the modified frmSample03.cs. First is from the OnLoad handler:
//Boolean (CheckBox)
grid[currentRow, 0] = new SourceGrid.Cells.Cell("Boolean (CheckBox)");
grid[currentRow, 0].View = captionModel;
grid[currentRow, 1] = new SourceGrid.Cells.CheckBox(null, true);
SourceGrid.Cells.Controllers.CheckBox checkBoxClickEvent = new SourceGrid.Cells.Controllers.CheckBox();
checkBoxClickEvent.CheckedChangedSenderCellContext += new EventHandler(InvertDisabledCheckBox);
grid[currentRow, 1].Controller.RemoveController(grid[currentRow, 1].FindController());
grid[currentRow, 1].Controller.AddController(checkBoxClickEvent);
And last, the new InvertDisabledCheckBox:
private void InvertDisabledCheckBox(object sender, EventArgs e)
{
SourceGrid.CellContext context = (SourceGrid.CellContext)sender;
SourceGrid.Grid g = (SourceGrid.Grid)context.Grid;
if (g != grid)
return;
int row = context.Position.Row;
int col = context.Position.Column;
grid[row, 2].Value = !(((bool)grid[row, 2].Value));
}
Note that InvertDisabledCheckBox verifies that the grid in the context is the one you want. This allows use of multiple grids.
I plan on submitting these changes to the project.
Cal
[Less]
|
Posted
almost 10 years
ago
by
cable08
Is there a way I can have columnspan for certain row but not others in DataGrid?
Thanks in advance,
Alex
|
Posted
almost 10 years
ago
by
cable08
Is there a way I can have columnspan for certain row but not others in DataGrid?
Thanks in advance,
Alex
|
Posted
almost 10 years
ago
by
dooholee
I used usercontrol ComboBox in SurceGrid cells like bellow.
But it's position was not on own cell.
(actually, it going to right position after resige coloumns)
and also how i can get control linked to surcegrid cells.
This is my code :
... [More]
grid1.LinkedControls.Add(new SourceGrid.LinkedControlValue(usedcontrol_marineColourCombo, new SourceGrid.Position(RowIndex, ColumIndex)))
[Less]
|
Posted
almost 10 years
ago
by
dooholee
I used usercontrol ComboBox in SurceGrid cells like bellow.
But it's position was not on own cell.
(actually, it going to right position after resige coloumns)
and also how i can get control linked to surcegrid cells.
This is my code :
... [More]
grid1.LinkedControls.Add(new SourceGrid.LinkedControlValue(usedcontrol_marineColourCombo, new SourceGrid.Position(RowIndex, ColumIndex)))
[Less]
|
Posted
almost 10 years
ago
by
ksukat
Didn't see project example or documentation describing how to create a grid like the appointment grid shown on sourcegrid.codeplex.com. Anyone have any pointers ?
Also, the install says to copy the sourcegrid.dll file. First I am using visual
... [More]
studio 2010 professional. Second, the zip download doesn't seem to have that file. It has sourcegrid2.dll under sourcegrid project bin/release, should that be used ? If so, should that be copied to my project directory, or somewhere else?
thanks.
[Less]
|