Questions tagged [datarowview]

In WPF, a DataRowView is a customized view of a DataRow.

A DataRowView object exposes values as an object array that has an index in the underlying table. DataRowView has the Row property that points to the DataRow being used.

59 questions
0
votes
2 answers

What is the class name/type of dr["MyColumn"] object in .Net?

I would like to create the function and pass the values to reduce the duplicate codes in my coding. It will be called like this in GridView ItemDataBound event DataRowView drv = e.Row.DataItem as…
TTCG
  • 8,805
  • 31
  • 93
  • 141
0
votes
1 answer

Get value from listview

What is happening in this code is that the drv variable is being null while the count of items in the listview is 3. Can any one tell me what i'm doing wrong please? private void btn_save_Click(object sender, RoutedEventArgs e) { DataRowView…
0
votes
0 answers

How to edit specific field value,only if another field value is changed?

I have WinForm aplication,.Net framework 4.5 with vs2012 and Sqlserver 2008 R2. In my form i use "BindingSource_CurrentItemChanged" to add new value if row.IsNew (user insert a new row) DataRowView row = (DataRowView) this.BindingSource.Current; …
0
votes
1 answer

How to set value in a field by UI?

I use three fields in Sqlserver Datavbase tables, for prevent delete records permanently by user: IsDelete (bit) DeletedDate (DateTime) DeletedUserID (bigint) I wish to set third field (DeletedUserID) by UI by some thing like this: …
0
votes
3 answers

Unable to cast object of type 'System.Int32' to type 'System.Data.DataRowView'

I need to retrieve the "id" from datasource of the selected item, but it always throws the same error mentionned in the title. Here is my code Dim DMV As DataRowView = LbMCat.SelectedValue 'Here occurs the error SelectedMainCat =…
Chaibi Alaa
  • 83
  • 2
  • 12
0
votes
1 answer

Finding Column value in GridView

I would like to get the column (Description) from DataRowView.I have the following code. protected void GridView1_RowCreated(object sender, GridViewRowEventArgs e) { if (e.Row.DataItem != null) { …
0
votes
1 answer

wpf treeview get selected value

I have a TreeView and a ListBox. Both of them get populated from different DataTables. The Treeview gets its data from: DataTable product_type = new DataTable(); product_type.Columns.Add(new DataColumn("id_product_type", typeof(int))); …
acosta
  • 89
  • 1
  • 1
  • 7
0
votes
1 answer

check distinct values in datarowview.row.itemarray other than empty string

I am getting datarowview through the following code DataRowView s = grdSampleData.GetRow(grdSampleData.FocusedRowHandle) as DataRowView; how can i check here that all values in s.Row.ItemArray is distinct. If value is null or empty string it should…
Rajeev Kumar
  • 4,901
  • 8
  • 48
  • 83
0
votes
1 answer

How to update gridview row without datarowview?

In my RowDataBound event I would like to update the row values, but I can't convert my object to a DataRowView. Is there another way to update the row columns? Here's what I have. It can't convert type Offer to DataRowView. /// ///…
chobo
  • 31,561
  • 38
  • 123
  • 191
0
votes
2 answers

Binding a TextBox to a particular DataRowView in a BindingSource IList property

In my application I have a table containing data for various regions within an organization with related tables containing statistical data about each region. For simplicity I'll represent them as: ____________ ________________ …
Zach Johnson
  • 682
  • 7
  • 14
-1
votes
1 answer

Unable to Cast object of Type `CustomObject` to System.Data.DataRowView exception

i recently ran into and Error looking like this: "unable to cast object of type pPP_2.Module to type System.Data.DataRowView". I have a Datagrid inside my Code which has a Button column. Look like this: Xaml Code behind:
IRezzet
  • 13
  • 9
-1
votes
2 answers

How to compare values in two wpf datagrid values if already listed?

am tryied the below code for checking the sid value,there are two datagrid, In one datagrid,am select a row and send to another datagrid2 with a tabindex am mentioned here. First time when am sent means,it want to add to datagrid2.Then if am again…
Ramji
  • 43
  • 3
  • 12
-2
votes
1 answer

Checking if a datarowview is null?

I'm facing an issue when trying to verify if a cell of a wpf datagrid is null, I always get a null reference exception even when I try to verify if it's null, can anyone help me here? code bellow for (int i = 0; i < commandeDataGrid.Items.Count;…
Saber CHETIOUI
  • 50
  • 1
  • 13
-4
votes
1 answer

Binding selected row to new data row and using import row VB.NET

I am binding a selected row to a new data row which needs to be added to a database. I am using the dt.Importrow(newRow) to add the new datarow to the data table. However, if I make changes to this new row, it also changes the selected row. code…
Fault Spot
  • 3
  • 11
1 2 3
4