datagrid

Displaying selected values only in VB6

馋奶兔 提交于 2019-12-31 07:31:19
问题 I am trying to display students in a datagrid that have "yes" as active. If the student has "no" as active, the form has to hide it and only show the students with "yes". The problem that I am recieving now is Syntax error in FROM clause. code: Private Sub Form_Load() Dim sql As String connSearch.Open connstr Adodc1.ConnectionString = conn.connstr sql = "select * from Table1 where Active <>" & "'No'" Adodc1.RecordSource = sql Set StudentTable.DataSource = Adodc1 Adodc1.Refresh Adodc1.Visible

Binding to fields containing a period in DataTable in C#/WPF

别来无恙 提交于 2019-12-31 02:41:29
问题 I have a SQL CE database, which is beyond my control, that has fields in the format of ., complete with a period in the column name. The columns will always be different, so I cannot have a strong-typed data field. I've been tasked with displaying dynamic table data into a DataGrid. Normally, this would be easy -- auto-generate the columns and everything is cool. Easy example. However, I'm not allowed to do this, since the '.' character in the column names nukes the binding. Right now, I'm

DataGridCheckBoxColumn loses IsReadOnly state when applying ElementStyle

无人久伴 提交于 2019-12-30 19:52:26
问题 I need to vertically center a DataGridCheckBoxColumn . Since I did not find a Property inside DataGridCheckBoxColumn , I applied an ElementStyle . However, when this style is applied, my CheckBox becomes checkable again, although it is set to ReadOnly in my DataGrid (the whole Datagrid is ReadOnly ), and in DataGridCheckBoxColumn itself. How can I create a vertically centered CheckBox that keeps its ReadOnly state? Here is my code: <DataGrid IsReadOnly="True"> <DataGrid.Columns>

DataGridCheckBoxColumn loses IsReadOnly state when applying ElementStyle

青春壹個敷衍的年華 提交于 2019-12-30 19:52:08
问题 I need to vertically center a DataGridCheckBoxColumn . Since I did not find a Property inside DataGridCheckBoxColumn , I applied an ElementStyle . However, when this style is applied, my CheckBox becomes checkable again, although it is set to ReadOnly in my DataGrid (the whole Datagrid is ReadOnly ), and in DataGridCheckBoxColumn itself. How can I create a vertically centered CheckBox that keeps its ReadOnly state? Here is my code: <DataGrid IsReadOnly="True"> <DataGrid.Columns>

How to prevent rows in datagrid from flickering while application is running

一笑奈何 提交于 2019-12-30 18:55:36
问题 In the application I'm developing at the moment I'm using a datagridview to display data. To fill it, I've to press a button and a backgroundworker will start running, it will fill a datatable and when it's finished running it will use the datatable as the datasource for the datagrid. This works fine, the UI stays responsive et cetera. But now I've implemented coloring to the rows, depending on their values (Im still playing around with it, so any suggestions are welcome): private void

DataGridCell Validation.ErrorTemplate ignored

假如想象 提交于 2019-12-30 18:33:41
问题 I'm trying to set the Validation.ErrorTemplate of the DataGridCells, here's the xaml code: <Style x:Key="{x:Type DataGridCell}" x:Uid="dataGridCellErrorTemplate" TargetType="{x:Type DataGridCell}"> <Setter Property="Validation.ErrorTemplate"> <Setter.Value> <ControlTemplate > <Border BorderBrush="Green" BorderThickness="2" ToolTip="Heidenei"></Border> </ControlTemplate> </Setter.Value> </Setter> <!-- following line only for demonstration that the setter is working ... --> <Setter Property=

Flex Datagrid - how to obtain item for mouse x/y coordinates?

怎甘沉沦 提交于 2019-12-30 12:25:29
问题 my mission is to select an item in a DataGrid instance with nothing but the coordinates on screen. We are implementing right-click functionality in our Flash application, with the goal of being able to right-click a DG row, which would select that row plus show a popup window containing some context commands. I have managed to get the right click event into my Flex app with the help of this site. Further progress so far has been to obtain the DataGrid instance via var objects : Array = this

Flex Datagrid - how to obtain item for mouse x/y coordinates?

微笑、不失礼 提交于 2019-12-30 12:25:11
问题 my mission is to select an item in a DataGrid instance with nothing but the coordinates on screen. We are implementing right-click functionality in our Flash application, with the goal of being able to right-click a DG row, which would select that row plus show a popup window containing some context commands. I have managed to get the right click event into my Flex app with the help of this site. Further progress so far has been to obtain the DataGrid instance via var objects : Array = this

Check box in Datagrid wpf c# application

北战南征 提交于 2019-12-30 11:27:10
问题 I am creating an C# wpf application for student records using datagrid. How to create check box in header to select/deselect all check boxes in a row ? How to select check box in row with one click so that we can edit/delete record ? and how we can select multiple check boxes to delete ? 回答1: use sth like this: DataGridCheckBoxColumn cbc = new DataGridCheckBoxColumn(); dataGrid.Columns.Add(cbc); CheckBox cb = new CheckBox(); cbc.Header = cb; and handle Checked and UnChecked events: cb.Checked

WPF DataGrid columns: how to manage event of value changing

纵然是瞬间 提交于 2019-12-30 11:01:08
问题 In my WPF C# project, I have a Datagrid as follows: <DataGrid x:Name="FixedPositionDataGrid" HorizontalAlignment="Left" Margin="33,229,0,0" VerticalAlignment="Top" Width="172" Height="128" AutoGenerateColumns="False" FontSize="10" CanUserAddRows="False"> <DataGrid.Columns> <DataGridTextColumn Header="indice" Binding="{Binding index}" IsReadOnly="True"/> <DataGridTextColumn Header="%" Binding="{Binding percentage}" /> <DataGridComboBoxColumn x:Name="DataGridComboBoxColumnAlignment" Header=