Skip to content

Commit fe147fd

Browse files
author
Jake Ginnivan
committed
Merge pull request #129 from JakeGinnivan/GridUpdates
Fix: searching Rows and Cells in Table (Winforms.DataGridView) for local...
2 parents 169953c + f428535 commit fe147fd

File tree

17 files changed

+261
-63
lines changed

17 files changed

+261
-63
lines changed

src/TestApplications/WindowsFormsTestApplication/Form1.Designer.cs

Lines changed: 64 additions & 51 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/TestApplications/WindowsFormsTestApplication/Form1.cs

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,19 @@ public Form1()
2121
TreeView.Nodes.Add(treeViewItem);
2222
PopulateDataGrid();
2323
PropertyGrid.SelectedObject = new BasicTypes("str", false, 6, 1.2f);
24+
DataGridControl.DataSource = TestItems;
25+
}
26+
27+
public TestItem[] TestItems
28+
{
29+
get
30+
{
31+
return new[]{
32+
new TestItem {Id = 1, Contents = "Item1", Description = "Simple item 1"},
33+
new TestItem {Id = 2, Contents = "Item2", Description = ""},
34+
new TestItem {Id = 3, Contents = "Item3"}
35+
};
36+
}
2437
}
2538

2639
private void GetMultiple_Click(object sender, System.EventArgs e)

src/TestApplications/WindowsFormsTestApplication/Form1.resx

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -120,6 +120,9 @@
120120
<metadata name="toolTip1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
121121
<value>17, 17</value>
122122
</metadata>
123+
<metadata name="toolTip1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
124+
<value>17, 17</value>
125+
</metadata>
123126
<assembly alias="System.Drawing" name="System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
124127
<data name="Image.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
125128
<value>
@@ -345,6 +348,21 @@
345348
<metadata name="details.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
346349
<value>True</value>
347350
</metadata>
351+
<metadata name="name.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
352+
<value>True</value>
353+
</metadata>
354+
<metadata name="country.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
355+
<value>True</value>
356+
</metadata>
357+
<metadata name="alive.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
358+
<value>True</value>
359+
</metadata>
360+
<metadata name="display.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
361+
<value>True</value>
362+
</metadata>
363+
<metadata name="details.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
364+
<value>True</value>
365+
</metadata>
348366
<metadata name="ToolStrip2.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
349367
<value>829, 17</value>
350368
</metadata>
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
namespace WindowsFormsTestApplication
2+
{
3+
public class TestItem
4+
{
5+
public int Id { get; set; }
6+
public string Contents { get; set; }
7+
public string Description { get; set; }
8+
}
9+
}

src/TestApplications/WindowsFormsTestApplication/WindowsFormsTestApplication.csproj

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -120,6 +120,7 @@
120120
<Compile Include="Scenarios\WindowWithScrollbars.Designer.cs">
121121
<DependentUpon>WindowWithScrollbars.cs</DependentUpon>
122122
</Compile>
123+
<Compile Include="TestItem.cs" />
123124
<EmbeddedResource Include="Scenarios\CustomUIItem\CustomUIItemScenario.resx">
124125
<DependentUpon>CustomUIItemScenario.cs</DependentUpon>
125126
</EmbeddedResource>

src/TestApplications/WpfTestApplication/MainWindow.xaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,9 @@
8080
</StackPanel>
8181
</StackPanel>
8282
</TabItem>
83+
<TabItem Header="Data Grid">
84+
<DataGrid x:Name="DataGridControl" AutoGenerateColumns="True" ItemsSource="{Binding Path = TestItems}"/>
85+
</TabItem>
8386
</TabControl>
8487
<GroupBox Header="Scenarios" Grid.Row="3" Grid.Column="1" AutomationProperties.AutomationId="ScenariosPane">
8588
<StackPanel>

src/TestApplications/WpfTestApplication/MainWindow.xaml.cs

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -158,5 +158,17 @@ private void ClickMe_OnClick(object sender, RoutedEventArgs e)
158158
{
159159
AutomationProperties.SetHelpText(this, "Click Me Clicked");
160160
}
161+
162+
public TestItem[] TestItems
163+
{
164+
get
165+
{
166+
return new[]{
167+
new TestItem {Id = 1, Contents = "Item1", Description = "Simple item 1"},
168+
new TestItem {Id = 2, Contents = "Item2", Description = ""},
169+
new TestItem {Id = 3, Contents = "Item3"}
170+
};
171+
}
172+
}
161173
}
162174
}
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
namespace WpfTestApplication
2+
{
3+
public class TestItem
4+
{
5+
public int Id { get; set; }
6+
public string Contents { get; set; }
7+
public string Description { get; set; }
8+
}
9+
}

src/TestApplications/WpfTestApplication/WpfTestApplication.csproj

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -123,6 +123,7 @@
123123
<Compile Include="Scenarios\HorizontalGridSplitter.xaml.cs">
124124
<DependentUpon>HorizontalGridSplitter.xaml</DependentUpon>
125125
</Compile>
126+
<Compile Include="TestItem.cs" />
126127
<Compile Include="ListControls.xaml.cs">
127128
<DependentUpon>ListControls.xaml</DependentUpon>
128129
</Compile>

0 commit comments

Comments
 (0)