Highlight column of grid - c#

i need to highlight a column of a grid when clicked for sorting.

Related

change a row template in silverlight datagrid for a particular row

i have a datagrid with 10 rows. The columns are all of type textbox . But only for the 7th row i want the column template to be combobox instead of textbox. can this be done ?? Any examples ?
I think you can achieve this by having both textbox and combox in the celltemplate and Hide combox for all other rows except 7th row and Hide textbox for 7th row.

how to send WPF DataGrid row to bottom of DataGrid depending on condition

I have datagrid on window. I want to send specific row at the bottom of grid depending on condition in code.
For ex:
if(!Row.Isenable)
{
///send this row to bottom of grid
}
how can I do this?

Highlight a row with particular color in datagrid

I have a data grid with multiple rows. My requirement is whenever I select a row it should be highlighted. I have disabled the cell selection by giving Background color same as selection color so user feel cell is not selected.
But how to select a row in data grid and highlight it with some color by changing some property ..i am using the following code to make user feel that the cell is not selected.
dataGridViewCellStyle11.SelectionBackColor = System.Drawing.SystemColors.Window;
dataGridViewCellStyle11.BackColor = System.Drawing.SystemColors.Window;
A few questions, do your users need to be able to select individual cells? Since you changed the color of the cell select to make it seem like it is not selected, then how do you decide when to highlight the full row?
It sounds like you want to change the SelectionMode property on your DataGridView. If you change it to FullRowSelect then you will highlight your entire row when any cell in the row is selected.
dataGridView1.SelectionMode = DataGridViewSelectionMode.FullRowSelect;

Grid with specified Row and Column Definitions: How to fill each cell with ListBox Selected Items?

Grid supposed to have both 3 RowDefinition and ColumnDefinition (Every cell has no element)
I already accomplished this scenario using UniformGrid.. BUT unfortunately the image sizes are ultimately the same to fill each cell with the ListBox SelectedItems.
Just this: ItemsSource="{Binding ElementName=ListBoxCollection, Path=SelectedItems}"
I try to use Grid to make use of RowSpan and ColumnSpan BUT everytime I select an item on my ListBox it only shows the latest selected item and not filling each cell with selected items like UniformGrid does.
Meaning it shows only 1 image at a time and changes everytime I select another.
All I want is to bind and fill each cell with the ListBox SelectedItems.
Can I accomplish this in XAML?
Or please suggest some control or panel that accomplish the same thing I wanted.

Auto stretching of adjacent column size when the current column has a lot of elements in a gridview

I have two columns in a table in ASP.NET page. In the first column I have a Grid View that gets populated from the database using the SQLDATASOURCE.
In the second column I have certain textboxes and checkboxes and buttons.
When I run the page in a browser, the data gets populated in the gridview which actually disturbs the alignment of the adjacent column that contains the textboxes and the checkboxes.
These textboxes and checkboxes that are supposed to be visible at the top of the column are now visible at the center because the gridview data populated disturbs it.
Please help with this as I want these textboxes and checkboxes in the second column to be visible at the top of the column.
You need to set the vertical alignment of your second table cell:
<td style="vertical-align:top">xx</td>
The default value is "middle" which is why your content gets pushed to the middle as the vertical height of the table cell gets taller than your content.

Categories

Resources