Other Issues - related wpf
Asked By siv h on 27-Nov-12 07:06 AM
dataGrid cell text enter validate that cell text and get the cell value also.
ex: in datagrid
Quantity Rate Amount
-- 50 --
here i enter the Quatitly feild in text box automatically validate the entered text and calculate the amount field and display.
any body please help me.
im new to this environment.
thanks
Robbe Morris replied to siv h on 27-Nov-12 08:52 AM
how validate datagrid cells in windows application. . . i want enter numeric values only in datagrid cells. . . . You can use CellValidating event. Here's a sample: private void dataGridView1_CellValidating( object sender a sample < asp : BoundField DataField = "ID" DataFormatString = "{0:N0}" HeaderText = "ID" SortExpression = "ID" / > keywords: TryParse, datagrid description: how validate datagrid in c# how validate datagrid cells in windows application. . . i want enter numeric values only
i am trying to validate the datagrid column dynamically the code is.but it allows to go to next cell of a ByVal sender As Object, ByVal e As System.EventArgs) Handles dgdOrder.CurrentCellChanged dgdOrder = CType(sender, DataGrid) ColNo = dgdOrder.CurrentCell.ColumnNumber - 1 ColName = dgdOrder.TableStyles(0).GridColumnStyles(ColNo).MappingName If ColName = "fldQty 0).ReadOnly = False End Sub the current cell, when the validation fails. keywords: TableStylesDataRowView, EventArgs, DataGrid, VB.NET, Color description: validate the datagrid column dynamically i am trying to validate the datagrid column dynamically the code is.but
from vb to C# C# .NET 06-Jun-13 10:31 AM Dim oGrid As DataGrid = CType(e.Item.FindControl _ ("dgr2"), DataGrid) DataGrid oGrid = (DataGrid)e.Item.FindControl("dgr2"); keywords: DataGrid, FindControl, conversion description: Another conversion from vb to C# Dim oGrid As DataGrid = CType(e.Item.FindControl _ (dgr2 DataGrid) 06-Jun-13 10:31 AM
Hi Frndz, Functionality: Use of Page.Validate() Using Page.Validate() :: Validate all validation Group with in page is validate or not. It means required field, regular expression with validation group fullfill its condition or not. If you want to validate any single validation group then use Page.Validate( "ValidationGroupNam" ); Using Page.IsValidate means its return true / false boolean. If all validation success return check this link. http: / / weblogs.asp.net / rajbk / archive / 2007 / 03 / 15 / page-isvalid-and-validate.aspx http: / / msdn.microsoft.com / en-us / library / 0ke7bxeh.aspx keywords: Page, boolean, ASP.NET
<DataGrid> <DataGrid.Columns> <sdk:DataGridTemplateColumn Header = "Internal Order No. " Width = "120" > <sdk:DataGridTemplateColumn.CellTemplate> <DataTemplate> <TextBlock Foreground TwoWay}" ToolTipService.ToolTip = "{Binding IONumber}" HorizontalAlignment = "Stretch" VerticalAlignment = "Stretch" / > < / DataTemplate> < / sdk:DataGridTemplateColumn.CellTemplate> < / sdk:DataGridTemplateColumn> < / DataGrid.Columns> < / DataGrid> In this silverlight DataGrid Sorting is not Supported how to set the Sorting Navigation for header in this DataGrid. . . . . . hi What you want is a natural string sort comparer, using the IComparer interface. There Natural Sort Order in C# http: / / www.codeproject.com / KB / recipes / csnsort.aspx keywords: Silverlight, DataGrid, WPF, silverlight DataGrid, IComparer, Sort, Sorting description: How to set the sorting for this Silverlight
in rowdetailtemplate of a datagrid control i hav a grid which have a listbox control. <datagrid . . . . . . . . . . . . . > . . . . . . . . . . . . . . <DataGrid.RowDetailsTemplate > <DataTemplate > <Grid . . . . . . > . . . . . . . . . . . <listbox x:name = "lstTest" . . . . . . / > < / grid> < / DataTemplate> < / DataGrid.RowDetailsTemplate > < / datagrid> now how can i access that listbox in codebehind . i m trying loaded event of DataGridRowDetailsEventArgs e) { Grid objGrid = ((Grid)e.DetailsElement); ListBox objListBox ; objListBox = (ListBox)objGrid.Children[2]; } < Data : DataGrid.RowDetailsTemplate > < DataTemplate x : Name = "MyDataTemplate" > < StackPanel Orientation = "Horizontal" x : Name = "MyStackPanel"> < TextBlock Text = "The Selected Name = "IDTestBox" Text = "{ Binding ID }" / > < TextBox x : Name = "NameTextBox" Text = "{ Binding Name }" / > < / StackPanel > < / DataTemplate > < / Data : DataGrid.RowDetailsTemplate > I am gettting the values in the IDtestBox and Nametext. I want to get
how to add treeview as 1 column in datagrid, in main datagrid i want to display the data and if i click + button or symbol then it should display another datagrid inside the main datagrid. Is it possible to do in Windows application. Hope this helps http: / / social.msdn.microsoft link. The above link contains some samples. Try to implement them description: how to display datagrid inside datagrid in C# windows application how to add treeview as 1 column in datagrid, in main
Hi, I have a datagrid that has a Datatable as its DataSource. Now I enter the rows in the datagrid. Now if I want to rearrange the rows in some order what should I do grid. . . . So I need a solution for changing the Index of a row in the Datagrid. . . Please help me with a solution . . . I am using VB.NET and SQL SERVER2000 Thanks agree with u on that. . . Here is the solution for moving the rows of a datagrid UP / DOWN. . . . Hope its helpful. . . This one is for the UP button. . . . Dim Index As Integer = datagrid.CurrentRowIndex If Index > 0 And Index < = datagrid.VisibleRowCount - 1 Then For i = 0 To datagrid.VisibleColumnCount - 1 CurrInd = datagrid.CurrentRowIndex() Obj = datagrid.Item(CurrInd - 1, i) datagrid.Item(CurrInd - 1
The WPF DataGrid is meant for showing a large amount of data. Due to this, it is confusing first way to set alternate row colors is by setting the AlternatingRowBackground property of the DataGrid. < DataGrid AutoGenerateColumns = "False" AlternatingRowBackground = "LightBlue" Loaded = "DataGrid_Loaded"> <DataGrid.Columns> < DataGridTextColumn Header = "Column" Binding = "{Binding}" / > < / DataGrid.Columns> < / DataGrid > I used the Loaded event of the DataGrid to fill it up with items. Another way is to use the AlternationCount property, which