abdul
(Abdulsamad)
March 22, 2024, 12:47pm
1
Dear Team,
I want to clear UltraGrid with tool clear command.
Any one has done it before .
I have updated data in UltraGrid through BAQ , but now I want to clear it with new form .
If I am trying to create new record then existing Grid not getting clear with new PackId.
private void epiButtonC2_Click(object sender, System.EventArgs args)
{
// ** Place Event Handling Code Here **
EpiDataView partdv = ((EpiDataView)(this.oTrans.EpiDataViews[“SubShipD”]));
System.Data.DataRow
Partrow = partdv.CurrentDataRow;
abdul
(Abdulsamad)
March 22, 2024, 12:47pm
2
I tried this but not working
myGrid.Rows.Clear();
1 Like
klincecum
(Kevin Lincecum)
March 22, 2024, 1:10pm
3
Is this a grid you created or an existing grid?
Is it bound to a datasource?
abdul
(Abdulsamad)
March 22, 2024, 3:22pm
4
Yes , this is Grid which I have created and data load by Button. Working fine , No issue in that but When I go for another new packId then same Grid existed which I have created for previous PacKID.
abdul
(Abdulsamad)
March 22, 2024, 3:23pm
5
It would be great , if you can assist , how can I clear grid or remove this Grid view and load fresh for new PackID.
If I clear form then this UltraGid also should be Clear
klincecum
(Kevin Lincecum)
March 22, 2024, 3:25pm
6
Set the datasource to null.
abdul
(Abdulsamad)
March 22, 2024, 3:27pm
7
That would be great if you can help out with codes
klincecum
(Kevin Lincecum)
March 22, 2024, 3:29pm
8
myGrid.DataSource = null;
abdul
(Abdulsamad)
March 22, 2024, 3:31pm
9
I used it but not working
abdul
(Abdulsamad)
March 22, 2024, 3:33pm
10
Which event I need to select to execute it ?
klincecum
(Kevin Lincecum)
March 22, 2024, 3:38pm
11
AfterToolClick, “ClearTool” I think.
You may have to clear the datasource, then refresh the grid.
abdul
(Abdulsamad)
March 22, 2024, 3:38pm
12
private void baseToolbarsManager_ToolClick(object sender, Infragistics.Win.UltraWinToolbars.ToolClickEventArgs args)
{
if (args.Tool.Key == "ClearTool")
{
epiUltraGridC2.DataSource = null;
}
}
klincecum
(Kevin Lincecum)
March 22, 2024, 3:40pm
13
private void baseToolbarsManager_ToolClick(object sender, Infragistics.Win.UltraWinToolbars.ToolClickEventArgs args)
{
if (args.Tool.Key == "ClearTool")
{
epiUltraGridC2.DataSource = null;
epiUltraGridC2.Refresh(); //? Maybe
}
}
abdul
(Abdulsamad)
March 22, 2024, 3:53pm
14
I tried this too
private void baseToolbarsManager_ToolClick(object sender, Infragistics.Win.UltraWinToolbars.ToolClickEventArgs args)
{
if (args.Tool.Key == “ClearTool”)
{
epiUltraGridC2.DataSource = null;
epiUltraGridC2.Refresh(); //? Maybe
}
}
But not working , after clear the form , Grid exits
abdul
(Abdulsamad)
March 22, 2024, 3:55pm
15
Message: --------compile errors------------
Error: CS1518 - line 516 (855) - Expected class, delegate, enum, interface, or struct
** Compile Failed. **