FAQ Database Discussion Community


Laravel 5 / zofe/rapyd-laravel Datagrid : ErrorException in Factory.php line 150: array_merge(): Argument #2 is not an array

laravel,datagrid,array-merge
This is my first post on stackoverflow :) I am new to Laravel and tried to display an array into a grid. I choosed zofe/rapyd-laravel Datagrid, but even if it seems simple I cannot get it to display.. Here is my code : public function index() { $reader = Reader::createFromPath('../uploads/pcl.csv');...

Placing Hyperlinks in DataGrid

c#,html,asp.net,datagrid,datatable
I am very statically trying to place hyperlinks into datagrid table rows. Because there are multiple datagrids on my page created by a repeater, not every datagrid (or column) requires a hyperlink. Currently I am doing this: foreach (DataRow row in tableCopy.Rows) { row[3] = "<a href:'" + row[3] +...

Custom WPF DataGrid with optional button column

c#,wpf,xaml,datagrid,custom-controls
I am creating a custom DataGrid control which has a property, ShowCloneColumn. If you set this property to true the DataGrid should add another column with a Button. The class I've created derives from DataGrid and implemented a Dependency Property, ShowCloneColumn. public static readonly DependencyProperty ShowCloneColumnProperty = DependencyProperty.Register("ShowCloneColumn", typeof(bool), typeof(CloneRowDataGrid),...

Bind a WPF datagrid column header to property in code behind

c#,wpf,xaml,binding,datagrid
Can someone tell me if this is possible. I have a WPF datagrid and I'd like to bind the column headers of the datagrid to properties/fields in the code behind. So heres what I've tried. This is my column code. <DataGridTextColumn Header="{Binding ElementName=frmAssetPPM, Path=HeaderProperty}" And this is what I've added...

Datagrid inside a Custom control is not updating

c#,wpf,xaml,datagrid
In my Custom Control that have a DataGrid and two buttons, one for add rows in this DataGrid and other button to remove elements. (because of my reputation I can not post an image here, sorry!) :-( My Custom Control code behind: /// <summary> /// Interaction logic for UserControl1.xaml ///...

How to edit HeaderText for TemplateColumn inside DataGrid

c#,asp.net,sql-server,datagrid
I have a client that is requesting that the HeaderText is changed for specific products so that instead of "TL Price/1000 sq ft" it says “TL Price per Pack”. On the previous page a customer can select multiple categories which will then show multiple tables on this page for the...

Setting AlternatingRowBackground for DataGrid with Templated DataGridRow

wpf,datagrid,styling
I need to have DataGrid with black and dark gray rows. By default it would have gray rectangle in the left of each row (marked by red in screenshot) which I don't need. To remove it I have to use Template for DataGridRow. The problem I get is that AlternatingRowBackground...

KnockoutJS: working example for editable grid

knockout.js,datagrid
I need a grid which allows switching between editation and viewing. After editing is finished the user can choose whether he wants apply or cancel his changes done on the edited row. Here is an example, which does exactly, what I need: http://jsfiddle.net/peterf/8FMPc/light/ But unfortunately this JSFiddle doesn't work with...

Structure of WPF DataGrid - change cells depending on value

c#,wpf,datagrid
I did bind an Object to a DataGridTextColumn and would like to reference one of its properties from within the corresponding CellStyle. I assumed that each cell of this column would contain an instance of MyObject. However I can't find a reference to the Object from within the DataGridCell (I...

Accessing complex object properties in a class initializer C# WPF

c#,wpf,linq,datagrid
I am trying to show data from my tblSysproStock table and display it in a datagrid. Some columns data types in the table are floats. Here is a code snippet of how I want to load the data in my datagrid: private void FillSysproDataGrid() { using (DataClassesDataContext DC = new...

ASP.NET DataGrid is empty

c#,asp.net,data-binding,datagrid
I have a ASP.NET datagrid which is on a user control. I have a main page which adds the user control ( sometimes multiple copies of the user control ) and restores them when a post back occurs. The dataGrid has insert / edit / delete links. I can add...

How to filter Datagrid using DateTime Picker?

vb.net,datagridview,datagrid,datepicker
I have two columns in Datagridview containing date & time stamp and status(string) which is from sql db updating in periodic interval. I want to filter the data in datagridview by datepicker in VB.net. Can any one help me how to do?...

WPF MVVM add row with two controls to Grid/DataGrid dynamically

c#,wpf,mvvm,datagrid
I am studying mvvm and face this problem with dynamic addition - in simple win forms I have done this easily with one loop and just few specification to DataRow.. So, the task is - to put all elements from List of strings to Grid/DataGrid, that contains two columns -...

Visual Basic Datagrid View change row colour

vb.net,datagridview,datagrid
Every other change to the datagrid view works fine but for some reason the row color just wont change. Ive debugged and my application goes through the loop to change the row color. Also I have a button that gives the datagrid view a new list and colors the rows...

ItemContainerGenerator.Items in .NET 4.0

c#,.net,wpf,datagrid,itemcontainergenerator
I started a project using .NET 4.5, now I have to switch to .NET 4.0. Everything works fine, except the "Items"-Property of ItemContainerGenerator is missing. I use it to find the row of a DataGrid that starts with the letter of a typed key. The Code is: ReadOnlyCollection<object> rows =...

WPF, DataGrid, clicked item/row does not highlight (blue background)

c#,wpf,linq,datagrid
Here is the DataGrid XAML: <DataGrid CanUserAddRows="False" AutoGenerateColumns="False" Height="501" HorizontalAlignment="Left" Margin="6,6,0,0" Name="dataGridTrades" VerticalAlignment="Top" Width="574" SelectionChanged="dataGridTrades_SelectionChanged"> <DataGrid.Columns> <DataGridTextColumn Header="ID" Binding="{Binding TradeID}" IsReadOnly="true"/> <DataGridTextColumn Header="Account" Binding="{Binding AccountName}" IsReadOnly="true"/> <DataGridTextColumn Header="Card Name" Binding="{Binding...

RowAction in a Vector source APYDataGridBundle Symfony 2

symfony2,vector,datagrid,doctrine2
Im stuck with this issue for a few days, i currently have grid filled with results from a Stored Procedure, i run a nativequery with the SP, get the results in an Array and use the Vector class from ApyDataGrid to display the results. All of the above is working...

Updating DataGrid causes GUI to hang?

c#,wpf,datagrid,.net-4.0
So I bind a DataGrid to an ICollectionView. I set the virtualization to True. <DataGrid EnableColumnVirtualization="True" EnableRowVirtualization="True" IsReadOnly="True" ItemsSource="{Binding ImportRecords, IsAsync=True}" Name="ImportRecordsView"> I create a task via TPL to populate an ObservableCollection (presumably not on the GUI thread). Task<ObservableCollection<myClass>> task = Task.Factory.StartNew( () => { var records = new ObservableCollection<myClass>();...

Flex update dataprovider after datagrid edited

flex,datagrid,itemrenderer,dataprovider
I have a datagrid in flex with an itemrenderer and a dataprovider. The problem is when I edit a datagrid, the provider don't get updated with the edited value. Here is my datagrid: <?xml version="1.0" encoding="utf-8"?> <mx:Canvas xmlns:mx="http://www.adobe.com/2006/mxml" width="100%" height="100%" borderColor="#FFFFFF" cornerRadius="0"> <mx:Script> <![CDATA[ import mx.core.Application; [Bindable] private var provider:ArrayCollection...

How do I highlight a row in the WPF DataGrid when SelectionMode is set to Cell

c#,wpf,datagrid
I have a DataGrid bound to a DataTable in a WPF application. The SelectionUnit of the DataGrid has to be set to Cell, but I'd also like to add a subtle highlight to the whole row so that on wide DataGrids, when the user scrolls off the selected cell they...

Datagrid show empty lines even that the datagrid keeps the values

c#,wpf,datagrid
Using WPF, Im having issues where the datagrid's data isn't being rendered and i can only see empty lines. (some data IS being inserted, debugged.) Even that the datagrid keeps the values in dg.ItemsSource its still show empty lines. XML code: <DataGrid Name="dg" Initialized="dg_Initialized" AutoGenerateColumns="False" CanUserResizeRows="False" CanUserAddRows="False" CanUserDeleteRows="False" IsReadOnly="True" ItemsSource="{Binding}"...

Identify auto generated TextBox

c#,wpf,datagrid,textchanged
I want to build a simple properties view where one can change each value. The properties are grouped by one name like this: name1: property1,property2 name2: property1,property2 ... So I created a DataGrid with a template to fill the grid (note that I removed every style property etc. and the...

How to change/prepopulate SelectedIndex for each individual Combobox in DataGridTemplate?

c#,wpf,xaml,datagrid,combobox
I currently have a DataGrid that has 2 columns, one of which is a DataGridTextColumn that will display items in an ObservableCollection of strings, and the second one being a DataGridTemplateColumn that holds the DataGridCellTemplate which contains the DataTemplate that displays the Combobox. The combobox also binds to an ObservableCollection...

Linq query to return country as column and cities as rows and count in cells

c#,sql,linq,binding,datagrid
I have this table in db : | Buyer Country| City |... |:-------------|-------:|... | Uk | Lisbon |... | Portugal | London |... | France | Madrid |... | France | Lisbon |... | France | Madrid |... | France | Madrid |... And i would like to get a...

Notify update of Tooltip Value (wpf)

wpf,xaml,binding,datagrid,notify
I have a Datagrid structure in xaml and several columns inside it: <DataGridTextColumn x:Name="QualityValueColumn" Binding="{Binding QualityValue}"> <DataGridTextColumn.CellStyle> <Style TargetType="DataGridCell"> <Setter Property="ToolTip" Value="{Binding MySelf, Converter={StaticResource ItemToTooltipConverter}}"/> <Setter Property="ToolTipService.ShowDuration" Value="48000"></Setter> <Setter Property="BorderThickness" Value="0"></Setter> </Style>...

Variable Date Format for WPF DataGrid in C#

c#,wpf,datagrid
I have a DateTime field in a List<> used as ItemSource in a WPF DataGrid that I would like to format differently depending on the value. If the DateTime value is within a year of DateTime.Now, I want to use 'MMM dd hh:mm' as formatting, if it is beyond a...

MVVM Light DataGrid binding

wpf,mvvm,data-binding,datagrid,mvvm-light
I'm developing a WPF with C#, .NET Framework 4.5.1, MVVM Light framework and Entity Framework 6.1.3. I have this DataGrid in a window: <DataGrid x:Name="LevelConfigurationDataGrid" Grid.Column="1" Grid.Row="1" Margin="20,0" ItemsSource="{Binding LevelConfigs}"> <DataGrid.Columns> <DataGridTextColumn Binding="{Binding CODE_LEVE}" Header="Nivel"/> <DataGridTextColumn Binding="{Binding CODE_NAME}" Header="Nombre"/> <DataGridTextColumn Binding="{Binding IS_ACTIVE}" Header="¿Activa?"/> <DataGridTextColumn...

Datagrid not showing data in wpf with c#

c#,wpf,xaml,datagrid
I am trying to use a dataGrid in WPF with c#. But I cannot get my datagrid to show any of my data in the table when I run my program in debug mode. I have this code executing when the datagrid loads. But all I see is an empty...

css specify first tr in table asp.net datagrid

asp.net,css3,datagrid,html-table,internet-explorer-10
I'm new to CSS and I'm trying to accomplish the following on IE10: I have the asp datagrid with the css class "maintbl" <asp:DataGrid CssClass="maintbl" ID="dg" runat="server" AutoGenerateColumns="False"> <Columns> <asp:BoundColumn ReadOnly="true" DataField="UpdateOn" DataFormatString="{0:MMMM d, yyyy}" HeaderText="Date Modified" SortExpression="UpdateOn" ></asp:BoundColumn> <asp:BoundColumn DataField="Message" HeaderText="Message" SortExpression="Message"></asp:BoundColumn> </Columns>...

c# changing background color of cell in dataGridView if its value changed

c#,datagrid,onchange
Hello I want to change the background color of a cell in a datagridview if its value changed. I have written the onChange event like this: private void dataGridView1_CellValueChanged(object sender, DataGridViewCellEventArgs e) { if (dataGridView1.Columns[e.ColumnIndex].Name == "Version") { //Change Background } } So how do I change the value of...

WPF boolean column checkbox

c#,wpf,checkbox,datagrid
I want to change the boolean checkbox of the "EstBonClient" cell in my Datagrid to a specific color. If the checkbox is checked the background color of the cell will be green and if the checkbox is not check the background color of the cell will be red. I want...

WPF DataGrid different controls in the same column - incorrect binding

c#,wpf,xaml,datagrid
I am developing the application which performs checks on the list of items. Each item has the list of the checks that need to be performed on it. Each check can be one of 3 types: CheckBox, ComboBox, TextBox. I would like to have Datagrid with 2 columns (one for...

Wpf-Datagrid and ObservableCollection-AutoGenerateColumns?

c#,wpf,datagrid
I have just worked out a solution to bind a property(DP) to Datagrid. Its okay and everything is smooth and soft. But when I run the application, The DataGrid Displays only blank rows!(Say there are 10 records, I see 10 Blank rows without columns!). The property is an ObservableCollection(of...

Checkbox column flickering when scrolling

wpf,vb.net,checkbox,datagrid
I want to make a simple table, whit a checkbox column. I created the table as DataGrid and bound it to a List of custom objects. Everything works fine, except I notice strange flickering effect, when I scroll the table. It looks like this: https://imgrush.com/-jI2FpNF385O What's the problem? How can...

Bug in a Scroll of DataGrid - WPF?

wpf,scroll,datagrid
I hope you can help me with this: I have a DataGrid with 20 rows and every time I check the checkbox in one of the columns, a label value is increasing by 100 each time or decreasing if unchecked. So, once I've checked all the rows the value of...

How do I delete selected grid row programmatically

c#,wpf,datagrid
I want to add and delete rows dynamically in the datagrid. This is the code that I use to add rows by using the click property of an add button: DataTable dt = new DataTable(); private void AddRow(object sender, RoutedEventArgs e) { DataRow dr = dt.NewRow(); DataGrid1.ItemsSource = dt.DefaultView; dt.Rows.Add(dr);...

How to bind EF dataSet with WPF datagrid?

wpf,linq,entity-framework,datagrid,dataset
I can't connect properly my dataSet (from EF) with WPF datagrid. My issue is that my datagrid shows : two selected column with correct column header (great :-) ! ) all other column (including two above) with column header from database (I don't want theses columns) Here is my code...

WPF DataGrid: Displaying 2 decimal places when not editing, but full number when editing

c#,wpf,datagrid,wpfdatagrid
im am trying to have a datagrid, where when the user enters the value and presses enter, it displays the data with 2 decimal points of precision. However when they click in to edit it, i want them to be able to view the whole number again. What i currently...

DataGrid row datatrigger/template

c#,wpf,binding,datagrid
I have the following DataGrid: <DataGrid ItemsSource="{Binding Coll.View}" SelectedItem="{Binding SelectedTransaction}" ScrollViewer.CanContentScroll="True" ScrollViewer.VerticalScrollBarVisibility="Visible" AutoGenerateColumns="False"> <DataGrid.Columns> <DataGridTextColumn Header="Date" Binding="{Binding Date}" Width="100" /> <DataGridTextColumn Header="Category" Binding="{Binding Path=SelectedCategory.CategoryName}" Width="100" /> <DataGridTextColumn Header="Payee" Binding="{Binding...

Filling Datagrid with DataTable wpf

c#,wpf,datagrid
I am trying to fill DataGrid. But i get exception of type 'System.Windows.Markup.XamlParseException' occurred in PresentationFramework.dll Here is my code: public partial class Course : Window { public Course() { InitializeComponent(); DataTable dt = new DataTable(); dt.Columns.Add(new DataColumn("Col1", Type.GetType("System.String"))); dt.Columns.Add(new DataColumn("Col2", Type.GetType("System.String"))); dt.Columns.Add(new DataColumn("ButtonsList", Type.GetType("SchoolDesktopClient.ButtonsList"))); dt.Rows.Add("Test1", "Test1", new...

Change DataGrid cell value in VB6

datagrid,vb6
Good day guys. I am developing VB6 project and I know it's old but thats the standard in Japan. I am not into datagrid expert guy that can tweak everything inside of it but my problem is that I have data to be displayed in datagridview which they want to...

ASP DataGrid - Must declare the scalar variable “@LCompanyIDInt” [closed]

sql,asp.net,vb.net,sql-server-2005,datagrid
I have an application I'm working on that have multiple grid views on panels, and those panels are selected by a dropdown list. The first one I'll put here works perfectly. I have a second grid set up exactly the same (I think) as the first. I've changed variable names...

Insert a blank row into a Datagrid with dynamic columns

c#,silverlight,datagrid
I create the columns of my Silverlight DataGrid dynamically in the code behind using a List as follows: private void BuildQuotationDGColumns(List<ProductCategory> ProdCatList) { // add a template column with drop down list of products DataGridTemplateColumn ProductColumn = new DataGridTemplateColumn(); ProductColumn.Header="Choose Product"; ProductColumn.CellTemplate=(DataTemplate) Resources["ProductDDLTemplate"]; QuotationDG.Columns.Add(ProductColumn); // for each entity in ProdCatList...

Setting a Datagrid Column to read only during run time

vb.net,windows,visual-studio-2010,datagrid
I have a datagrid, not a datagridview, where I wan to make a column read only if radio button is checked or not. So I define the column dynamically from a sql query: Dim bool_col As New FormattableBoolColumn bool_col.HeaderText = "Bool Colunm" bool_col.MappingName = "bool_col" Also on the form are...

In a WPF datagrid, how do I get the new row after cell edit?

c#,wpf,datagrid
My DataGrid is bound to a DataTable. After each cell edit in the grid, I need to get the new DataRow value. I get the new values only after the focus is lost from the row and not the cell. <DataGrid ItemsSource="{Binding}" CellEditEnding="grid_CellEditEnding"/> private void grid_CellEditEnding(object sender, DataGridCellEditEndingEventArgs e) {...

Implementing datagrid gem & session helper methods

ruby-on-rails,ruby,ruby-on-rails-4,datagrid
I'm a newbie trying to implement the datagrid gem (https://github.com/bogdan/datagrid). Unfortunately, I'm getting three error messages: Error 1: undefined method 'filter' for #<UsersGrid:0x000000044e9400> Referring to: line `@grid.filter` in def index Error 2: undefined local variable or method 'user' for #<UsersController:0x007f821f434808> Referring to: line `link_to view_context.image_tag("delete.gif",...` in the controller. Error 3:...

Updating Database On CheckBox Check/Uncheck Event

c#,asp.net,checkbox,datagrid,webforms
I am trying to follow This tutorial on updating a database on the check/uncheck event of a check box. However, I am getting a compile error on this line of code Int64 nID = Convert.ToInt64(GridView1.DataKeys[((GridViewRow)chkStatus.NamingContainer).RowIndex].Value); And the compile error is Error 111 'object' does not contain a definition for 'Value'...

DataGridRowTemplateColumn - refactoring and using styles efficiently?

c#,wpf,xaml,datagrid
I currently have a big lump of XAML that I am struggling to refactor. <DataGrid x:Name="CurrentConfigDataGrid" ItemsSource="{Binding}" > <DataGrid.Resources> <ResourceDictionary Source="../ResourceDictionaries/MergedDictionary.xaml" /> </DataGrid.Resources> <DataGrid.ItemContainerStyle> <Style TargetType="{x:Type DataGridRow}" BasedOn="{StaticResource {x:Type DataGridRow}}" /> </DataGrid.ItemContainerStyle> <DataGrid.Columns> <DataGridCheckBoxColumn Width="25">...

GWT FlowPanel not adding widget

css,gwt,datagrid,flowpanel
I have a class that extends FlowPanel. I add a DataGrid widget and a Grid widget like this: dataGrid.setWidth("100%"); dataGrid.setHeight("100%"); grid.setWidth("100%"); grid.setHeight("100%"); this.add(dataGrid); this.add(grid); this.setWidth("100%"); this.setHeight("100%"); Only the DataGrid widget appears. I've tried both switching from FlowPanel to VerticalPanel and wrapping the Grid in a FlowPanel, with no joy. I...

How to remove EditSettings button from filter cell in DevExpress DataGrid

c#,wpf,datagrid,devexpress
I have the following column in my DevExpress datagrid: <dxg:GridColumn Width="Auto" AllowEditing="False" AutoFilterCondition="Equals" FieldName="Name" Header="Name" ShowInColumnChooser="False" SortOrder="Ascending" VisibleIndex="0"> <dxg:GridColumn.EditSettings> <dxe:ButtonEditSettings AllowDefaultButton="False"> <dxe:ButtonEditSettings.Buttons> <cm:ButtonInfo Content="X" Tag="RemoveItem" /> </dxe:ButtonEditSettings.Buttons> </dxe:ButtonEditSettings>...

.Net Reformat data in the List of List of Sting

c#,wpf,vb.net,xaml,datagrid
I have a List(Of List(Of String). list contains data like this: item-A1 item-A2 item-A3 item-B1 item-B2 item-B3 item-C1 item-C2 item-C3 I would like to somehow change it to this: item-A1 item-B1 item-C1 item-A2 item-B2 item-C2 item-A3 item-B3 item-C3 Is there a way to reformat data and shown in the example...

How to hide left part instead of right part of a WPF datagrid column when resize it?

wpf,datagrid,resize,datagridtextcolumn
I have a DataGridTextColumn that show list of batch download URLs. These URLs have same begin part, only different at the end. They are too long to display, so I resize this column by drag column header. Problem is it hide the right part of these URLs, while I want...

How to fill DataGrid in WPF using List?

c#,wpf,datagrid
I have this method which fill a list and it is prepared to fill DataGrid. I want to fill each data from this list in the specified and personalized a column here is the code : public List<Object[]> EventsDates(DateTime date1, DateTime date2, int idUser) { int dateStamp1 = Convert.ToInt32((date1 -...

Validating texbox control within gridview

c#,winforms,datagrid,.net-4.0
I am developing an application where teacher are allowed to enter marks for students, based on selecting a subject they teach. Now I am using a 4 columed datagrid to which I am populating all the student rollnum(1st col) and name (2nd col) and textbox control to enter Test marks(3rd...

DataGrid ItemRenderer

flex,datagrid,itemrenderer
Here's the thing: I've this DataGrid that holds a column with the purpose of handle some actions. So, this DataGrid have several data columns and, at the end there is this special column. At this special column named "operations" there are two icons; one of 'em shows an alarm icon...

Databinding a Datagrid

c#,wpf,data-binding,datagrid
After being unsuccessful in databinding my Observable collection to my datagrid (Another question in this same forum), i tried to reduce the scope. Now my project has only one datagrid, one ObservableColection and one class. But still my databinding is failing.. please help.. using System.Collections.ObjectModel; using System.Windows; namespace TestDatagrid {...

SELECT * FROM giving other result then SELECT 2010,2011 FROM

php,mysql,datagrid,livecode
when i try to get the values from some columns and use SELECT 2010,2011 FROM blablatable then i get only the table names(checked in a browser). When i use SELECT * FROM blablatable then i get (of course everything) but then the content of the year colums are displayed correct(checked...

Variable in stackpanel inside of DataGrid-RowDetailsTemplate is not recognize

c#,wpf,datagrid,rowdetailstemplate
I have stack panel inside DataGrid.RowDetailsTemplate. In the stack panel I have text Box and button. The function of the button in the c# code behind tried to use the value from the text box but there is an error : "The name 'toCheck' does not exist in the current...

MultiBinding with Multiple output

c#,wpf,mvvm,datagrid,imultivalueconverter
Lets consider an animal Model as following: public class Animal { public string name { set; get; } public int age { set; get; } } and a collection of Animal object as following: Dictionary<string, Dictionary<string, ObservableCollection<Animal>>> animals; in my ViewModel I populate animals like: var lions = new ObservableCollection<Animal>();...

WPF DataGrid Binding to CurrentItem or SelectedItem?

wpf,data-binding,datagrid
If I have a DataGrid in my View and a Property in my ViewModel that represents currently active DataGridRow (e.g. focused item or clicked item) should I bind my Property to SelectedItem or CurrentItem. Say I chose to bind it to SelectedItem, then What's CurrentItem for? should I bind another...

How to update Datagrid with an ItemsSource that doesn't know when an item is added?

c#,wpf,data-binding,datagrid
I know I Should implement the INotifyPropertyChanged interface if I want to notify the grid that it should update for the properties in the items, So I did and it was working before. I decided to change the getter of the bound ObservableCollection so that it would be relative to...

WPF: Programatically adding a ContextMenu to a DataGrid column header

c#,.net,wpf,datagrid,wpfdatagrid
I'm trying to add individualized and separate ContextMenus to each column header in my project, so that when a user right-clicks a header, a menu of checkboxes that relates to that header will appear that allows them to filter the data. A couple of catches: the project that I'm working...

Datagrid textblock not aligned on left border

c#,wpf,xaml,datagrid
This is probably a very stupid problem, which is also probably why I can't find an answer to it. I have a datagrid in which I add messages every once in a while during a lengthy operation, and for some reason the textblocks appear slightly a bit on the right...

Reset DataGrid.SelectedIndex after user has selected another

c#,wpf,datagrid,wpfdatagrid
In the UI I'm working with, in a DataGrid, there are cases where the user might select a different row, but after a dialog interaction, the old row needs to be shown as being selected once again. If I simply try BundleQueueDG.SelectedIndex = currentBundleIndex; that does not do anything and...

Can't add TemplateField to Datagrid

html,asp.net,visual-studio,drop-down-menu,datagrid
I am trying to add a DropDownList into the DataGrid so the location column can be easily changed. I am getting an error with TemplateField, itemtemplate, label and DropDownList. I get the build error: is not allowed within a 'System.Web.UI.WebControls.DataGridColumnCollection'. <asp:DataGrid runat="server" CssClass="tblResults" OnItemDataBound="dgList_ItemCreated" AllowSorting="true" OnSortCommand="dgTrailer_Sort" ID="dgTrailers" DataKeyField="ID" AutoGenerateColumns="false"> <Columns>...

Unexpected behavior of AlternativeRow BackColor in WPF

c#,wpf,datagrid,styles
I'm styling my DataGrid using an style provided by Microsoft at this page. I'm not changing this style except a single line as following that enables alternative row back color. <!--Style and template for the DataGrid.--> <Style TargetType="{x:Type DataGrid}"> <Setter Property="AlternationCount" Value="2"/> ... and the rest of the style I...

BindingExpression path error on datagrid

c#,wpf,datagrid
I have a datagrid that represent five columns, the last column contains only button. The xaml code for datagrid looks like: <DataGrid.Columns> <DataGridTextColumn Header="Prefix" Binding="{Binding Prefix, UpdateSourceTrigger=PropertyChanged}" Width="*" /> <DataGridTextColumn Header="Path" Binding="{Binding Path, UpdateSourceTrigger=PropertyChanged}" Width="4*" /> <DataGridTextColumn Header="User" Binding="{Binding User, UpdateSourceTrigger=PropertyChanged}" Width="1*" /> <DataGridTextColumn Header="Password"...

WPF Bind ListBoxItem to DataGrid

c#,wpf,datagrid,wpf-binding
I need to bind the ListBoxItem and DataGrid in the following way: A user doubleclicks on the ListBoxItem and the sql query is performed and the retrieved data is shown on the DataGrid. Here's what I have: <DataGrid x:Name="GridStatistics" Margin="0,144,0,0" /> <ListBox x:Name="LstStat" HorizontalAlignment="Left" Height="129" Margin="10,10,0,0" VerticalAlignment="Top" Width="330" FontSize="16" ItemsSource="{Binding...

WPF DataGrid Does not show data when the ItemsSource is set

c#,wpf,datagrid
I am trying to update a DataGrid from my sdf file using C# in Visual Studio 2010. The DataGrid is as follows. <Grid Height="auto" Name="grid1" Width="auto" > <Grid.RowDefinitions> <RowDefinition Height="{Binding ElementName=grid1, Path=ActualHeight}"/> </Grid.RowDefinitions> <Grid.ColumnDefinitions> <ColumnDefinition MinWidth="200" Width="200" Name="DGWidth"/> <ColumnDefinition MinWidth="600" Name="PIWidth"/> </Grid.ColumnDefinitions> <DataGrid AutoGenerateColumns="True" Grid.Column="1"...

Using the FooTable plugin with the ASP.NET DataGrid

asp.net,vb.net,gridview,datagrid,footable
I am currently redesigning an application for the company I work for. All the data is displayed through a DataGrid, which is fine, except for when I try to incorporate a JQuery library called "Footable" to make all the grids collapse when on a smaller device as explained here. In...

WPF DataGrid DataGridRow Selection Border and Spacing

wpf,datagrid,border,datatrigger
I'm using the WPF DataGrid to display data and when the user selects a row, I'd like the background of the entire row to be highlighted (with a gradient) and also to have a border. I've been using the following code, which works for the most part: <Style TargetType="DataGridRow"> <Setter...

Edit DataGrid Cell on mouse over

c#,wpf,datagrid,triggers,datagridcell
I have a DataGrid which has plenty rows and columns, I want to get the cell ready for editing when the user focus the mouse on it (IsMouseOver). So far, all I found is this <Window.Resources> <Style TargetType="{x:Type DataGridCell}"> <Style.Triggers> <Trigger Property="IsMouseOver" Value="True"> <Setter Property="Background" Value="green"></Setter> </Trigger> </Style.Triggers> </Style> </Window.Resources>...

WPF AutocompeteBox in datagrid Cell does not work properly

wpf,datagrid,autocomplete
I am testing the WPF AutoCompleteBox control in datagrid cell. I met two problems: 1) when i navigate to the autocomplete cell , it does not automatically switch to edit mode, 2) When I switch into edit mode and I type something, the list of suggesstions doesn’t appears and I...

Update DataGrid cell if other cell changes

c#,wpf,mvvm,datagrid
I have a View that displays a Part. All parts contain a list of identifiers. In my View I display Part Properties and a DataGrid with all the Identifiers of that part. Now if I change a value of an identifier, I want another value update to the default. But...

DataGrid Multiplicating Two Columns

c#,wpf,datagrid
I'm in need of the community's help. I am trying to multiply the values of two columns in a DataGrid (WPF and C#), the first column get its data from a MySql database and the second column is an input value where a user will type a number which should...

WPF ListBox select next item after deletion with ICommand

wpf,xaml,mvvm,datagrid,listbox
This question evolves kind of the same issue like this question, but it concerns a different problem that I face because I use bindings. I have added a button to delete the currently selected item from a ListBox (and one for a DataGrid where the same problem arises). The code...

WPF Binding DataGrid Not Updating

c#,wpf,datagrid
What did I do wrong? I was just trying to load the returned List to the grid view (BTW, could you also give me tips to properly apply the INotifyPropertyChanged in a Three-tier architecture, if you don't mind) MarkUp: <Grid Margin="10"> <DataGrid Name="PatientDataGrid" AutoGenerateColumns="False"> <DataGrid.Columns> <DataGridTextColumn Header="Id" Binding="{Binding Id}" />...

Set DataGridCell style depending on CheckBox Checked state in DataGridTemplateColumn

c#,wpf,checkbox,datagrid
I have a DataGrid with data binding to DataTable with columns set to auto generate. The first column has boolean data type replaced with DataGridTemplateColumn with CheckBox from DataTemplate. It all works fine as it is. However, now I want to make the DataGridCell background to red when the CheckBox...

Flex DataGrid Header Column Separator

flex,datagrid,flash-builder
I'm using an mx:DataGrid (in a Halo theme) and I'm having some issues with the header column separators/vertical grid line colors. Does anyone know how to customize/change the line color? Thanks! --Moe...

WPF + XAML + DataGrid + Powershell 2.0

wpf,xaml,powershell,datagrid
I'm trying to put a data grid in a WPF. Simple enough in Powershell.. But when i run the code in Powershell 2.0, it can't find gives me errors. Sample code: Add-Type -AssemblyName PresentationFramework $xaml = [xml] @" <Window xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" Title="My window" Height="300" Width="300"> <DockPanel> <Button x:Name="okButton" Content="OK" DockPanel.Dock="Bottom"...

How to bind a datagrid row with text boxes in wpf mvvm

wpf,mvvm,binding,datagrid
I have a DataGrid which contains some Product details , i need to load the product details into some textboxes when i double click on a particular product in the datagrid. Thanks in advance....

How to include an image as link for datagrid gem?

ruby-on-rails,ruby,ruby-on-rails-4,datagrid
I'm trying to implement the datagrid gem in Rails 4 but am not sure how to include a link in the Grid class. I currently have for the UsersGrid class: class UsersGrid include Datagrid scope do User.order("users.created_at desc") end column(:avatar) do |user| if user.avatar? link_to ActionController::Base.helpers.image_tag(user.avatar.url, alt: "Profile"), user_path(user) else...

Databinding ObservableCollection to Datagrid not working

c#,wpf,data-binding,datagrid,observablecollection
Update Now I think I have narrowed the problem. I created single class public class OptionStrike { public OptionStrike(double p1, double p2, int p3) { // TODO: Complete member initialization P_OI = p1; StrikePrice = p2; P_Volume = p3; } public OptionStrike() { // TODO: Complete member initialization } public...

WPF DataGrid Trigger on cell content

c#,wpf,datagrid,triggers
I have a datagrid than contains value comes from a stored procedure. All values are set Bold as FontWeight. I'd like to make the text normal when the cell content is equal to 0. How can I do that with a trigger? I do that but seems not working <DataGrid.CellStyle>...

WPF: Binding the items in a “sub-list” of a list

c#,wpf,xaml,binding,datagrid
I have a Datagrid in WPF that I bind to my ObservableCollection List, then I create the Columns for properties that I want, like the following ones: public int Name { get; set; } public DateTime Date { get; set; } public long Cod { get; set; } public long...

C# XAML - How to add a combobox to some datagrid ROWS but not others?

c#,wpf,xaml,datagrid,combobox
I'm using a key/value observable collection to hold data which is represented in the view by a two column datagrid. Some key values contain a list of items and other key values contain a single string value. Using the below code snippet I'm able to display those key values with...

Add three List to WPF datagrid

c#,wpf,datagrid
I need to add three List to one datagrid. Each list should have its own row. The lists will only be created/changed once - this is during data import from a CSV file. I know how to add two lists to the datagrid by using the following code: dtgCsvData.ItemsSource =...

MVVM pattern: an intermediate View between Command binding and ViewModel execute

c#,wpf,user-interface,mvvm,datagrid
Scenario Some date are loaded into a program (e.g., evaluation of students in a class where each student is a distinct entity with his/her evaluation data) and a summary of them is shown on a datagrid. The user selects selects some of the students, and performs an analysis on their...

Datagrid shows only one record

c#,wpf,datagrid,wpfdatagrid
everything looks fine from my point of view, but the dataGrid shows only the first item which has been added to the grid. The XAML part: <DataGrid HorizontalAlignment="Stretch" Name="dataGridIE" VerticalAlignment="Stretch" HeadersVisibility="All" CanUserReorderColumns="False" CanUserResizeColumns="False" AutoGenerateColumns="True" ColumnWidth="100" CanUserAddRows="True" CanUserDeleteRows="True" Height="97" Margin="23,38,16,38" Grid.ColumnSpan="2" Width="682"> <!--<DataGrid.Columns> <DataGridTextColumn Header="Key"...

Binding DataGirdComboBoxColumn to DataSet doesn't work

wpf,datagrid,dataset
I want to create a simple master-detail view in a datagrid. I tried to bind a DataGirdComboBoxColumn to a DataSet, but it won't work. Here's my xaml code: <DataGrid x:Name="DataGrid1" Grid.Column="0" Grid.Row="0" AlternatingRowBackground="#FFF0F0F0" ItemsSource="{Binding}" Height="420" AutoGenerateColumns="False"> <DataGrid.Columns> <DataGridTextColumn Header="ID" Binding="{Binding AirplaneID}" IsReadOnly="True" MinWidth="30"/> <DataGridTextColumn Header="Model" Binding="{Binding Model}" IsReadOnly="True" Width="Auto"...

IValueConverter does not pick up a change in bound collection

c#,wpf,xaml,datagrid
I have a datagrid with comboboxes in the headers to use as filters and I want to have all the distinct values in the respective column in the header combobox. Therefore I thought I should use a IValueConverter and bind the same collection has the datagrid has to each header...

WPF DatePicker DisplayDate binding does not work inside DataGrid/DataTemplate/ControlTemplate

wpf,datagrid,datepicker,datatemplate,controltemplate
It seems wpf DatePicker's DisplayDate binding does not work when datepiceker is inside datagrid or datatemplate. Here is the sample code <DataGrid x:Name="grid" AutoGenerateColumns="False" IsReadOnly="True"> <DataGrid.Columns> <DataGridTemplateColumn Header="StartDate" MinWidth="155"> <DataGridTemplateColumn.CellTemplate> <DataTemplate> <DatePicker SelectedDate="{Binding Path=StartDate}" /> </DataTemplate> </DataGridTemplateColumn.CellTemplate> </DataGridTemplateColumn>...

Extjs 4.2.2 - Default sorter logic runs instead of custom sorter

sorting,extjs,datagrid,extjs4.2
On ExtJs 4.2.2 I need to override default sorter of some column and make it sort by the absolute values (Math.abs). When I debug it I get into doSort() and get the right store & direction (asc, desc), but for some reason it doesn't execute rthe sorterFn() - and run...

c# MVVM update Datagrid after combobox selection

c#,wpf,mvvm,data-binding,datagrid
I am creating a small wpf programme which filters a dataset by date. It will eventually group and sum the data, but at the moment I am just trying to display the data rows. I want a window with a ComboBoxat the top with possible dates to select and a...

How to populate a DropDownList in a DataGrid?

c#,html,asp.net,drop-down-menu,datagrid
I have a DataGrid that displays information about trailers. I decided to change the location column to a DropDownList so the location can be easily changed. But I am not sure how to populate the DropDownList. <asp:DataGrid runat="server" CssClass="tblResults" OnItemDataBound="dgList_ItemCreated" OnRowDataBound="OnRowDataBound" AllowSorting="true" OnSortCommand="dgTrailer_Sort" ID="dgTrailers" DataKeyField="ID" AutoGenerateColumns="false"> <Columns> <asp:BoundColumn DataField="TrailerOwner" HeaderText="Owner"...

How to mark a multiple selection on a DataGrid control?

c#-4.0,datagrid
I've got a custom control based on a Datagrid. What I want to achieve is doing multiple selection of rows and then right click on the row selector to open a context menu. What actually happens: Selection of multiple rows works fine until the user right clicks on the row...

Unable to get code behind event to fire

asp.net,vb.net,datagrid
I have an asp.net datagrid which looks like this. I don't seem to be able to get the linkbuttons to fire. <asp:DataGrid ID="dgrdItem" runat="server" OnItemDataBound="dgrdItem_ItemDataBound" Width="100%" AutoGenerateColumns="False" OnSelectedIndexChanged="EditItem" > <HeaderStyle CssClass="datagridheaderstyle"></HeaderStyle> <Columns> <asp:TemplateColumn ItemStyle-Width="240" HeaderText="Name"> <ItemTemplate> <%#DataBinder.Eval(Container.DataItem, "Name")%></ItemTemplate>...

SelectedRow and DataBoundItem in WPF as it gets?

c,wpf,datagrid
I'm passing a basic design of client registration that was made in Windows Form to WPF, and I had a problem in the code that the WPF does not have the selectedRow and then immediately there is also the DataBoundItem. Does anyone know how I can transcribe this code for...

DataRowView object getting null value at time of getting value from DataGrid

c#,wpf,xaml,datagrid
Scenario is that i want to get vales from the selected row onMouseDoubleClick event. I cast the row to DataRowView but the object get no value. At the time of debugging when i hover my cursor on SelectedItem it show me the values but it does not cast it to...

Alter Display Text in Data Grid

c#,asp.net,datagrid
A Dynamic Datagrid is being created, and I need to alter the text being displayed in the data grid w/o changing the data in the database. I tried doing the below, but it presents an error of the below. If more code is needed to be seen, let me know....