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
13
votes
4 answers

How Can Convert DataRow to DataRowView in c#

Can or how to convert DataRow to DataRowView? For example: DataTable dt=ds.Tables[0]; DataRow dr= dt.NewRow(); DataRowView drv = ????
Harry Sarshogh
  • 2,137
  • 3
  • 25
  • 48
8
votes
2 answers

Get the DefaultView DataRowView from a DataRow

Here's the situation: I need to bind a WPF FixedPage against a DataRow. Bindings don't work against DataRows; they work against DataRowViews. I need to do this in the most generic way possible, as I know nothing about and have no control over…
user1228
3
votes
1 answer

How to get the selected object from the DataGridView?

I have a System.Windows.Forms.DataGridView to show the objects of my type IECInstance. I'm building a DataTable and fill the table with my objects and set the DataTable as DataSource of my DataGridView. So my DataGridView is showing my objects…
xoned
  • 2,701
  • 2
  • 31
  • 43
3
votes
1 answer

Passing entire Container.DataItem row to code behind

This question relates to ASP.Net 3.5 and C# I'm building an RSS Feed from a database containing a lot of columns. I need to format the data in a particular node and doing it inline is going to be very messy. I'm aware I can pass all the parameters…
2
votes
4 answers

Get SelectedItems from database fed ListBox

I need to get values from selected items from listbox which is binding from database. But if I try listBoxAtribute.SelectedItems[0].ToString() it returns System.Data.DataRowView Is there any way to convert Data from DataRowView to string? My idea…
BeerMaker
  • 41
  • 5
1
vote
3 answers

check the given date is present between fromdate to todate

My dataset format looks like this EMPNAME FRMDATE TODATE ANU 01-10-2012 01-20-2012 HARI 01-05-2012 02-05-2012 Now get input through a textbox as 01-17-2012 for a specific employee. My question is: how to check…
ssa
  • 37
  • 3
  • 9
1
vote
1 answer

DataRowVersion not working when using DataSet.ReadXML(...) to load data

So I've spent all day finding where the problem lies. If I don't use XML to load data into my DataSet (i.e. just grab it straight from a database or somesuch) then I have no problems at all. However, I have to read it from an XML file and I am…
Fugu
  • 361
  • 2
  • 6
  • 17
1
vote
1 answer

How do I send SelectedItems to a DataRowView array?

I'm creating a medical database application as the final project for my course, and I need to get each selected item in a listview checkbox thingo to a DataRowView array so I can insert each one into a database. I'm trying to do this via a loop but…
1
vote
1 answer

ComboBox shows System.Data.DataRowView first

So in windowsform I have 2 ComboBoxes and one CheckedListBox for exercises. When you select your typefitness (calisthenics, weights, cardio, etc.) and your musclegroup (tricep, chest, back, forearms, etc.) than you should get the exercises out of…
zhrgci
  • 584
  • 1
  • 6
  • 25
1
vote
1 answer

Set value of DataRowView

I am looking to modify a DataRowView value from an event. I have tried the following but it never changes the DataGridCheckBoxColumn ((DataRowView)repDataGrid.SelectedItem).Row.ItemArray[4] = true;
ullevi83
  • 199
  • 2
  • 17
1
vote
1 answer

Find Index of DataRowView in DataView

Is there a way to get the index of a selected DataRowView in a DataRow? I current have the following code private long GetSelectedIndex(DataView dataView, string searchString) { long selectedIndex = 0; foreach(DataRowView dataRow in…
jDave1984
  • 896
  • 4
  • 13
  • 43
1
vote
2 answers

DataRowView instead of value

I get an error whenever I try to run my application because instead of getting the real value of comboBox.SelectedValue, I get a DataRowView item. Here's the code where I'm getting the error: private void InitDataGridView() { query = "SELECT…
Alessio Raddi
  • 540
  • 1
  • 6
  • 20
1
vote
1 answer

How do I keep rows highlighted in a datagridview using RowFilter?

I am using RowFilter to highlight rows in a datagridview, but when i clear the filter to view all records it removes the highlight i applied: Sorter.DtSample.DefaultView.RowFilter = "FirstName = 'John'" For Each R0w In Sorter.DataGridView1.Rows …
Chrisetiquette
  • 311
  • 1
  • 4
  • 22
1
vote
3 answers

How do I add a new row to a binding source

I am trying to programmatically add a new row to a binding source . I know calling the bsSource.AddNew() adds a new row which I cast as a DataRowView and I set my values. My problem is this - the DataRowView.Row shows a RowState of detached. I do…
Ken
  • 2,518
  • 2
  • 27
  • 35
1
vote
4 answers

How can I get the string value of a checked item from a CheckedListBox?

I've got this code to try to extract the display value from a CheckedListBox: CheckedListBox.CheckedItemCollection selectedUnits = checkedListBoxUnits.CheckedItems; _selectedUnit = selectedUnits[0].ToString(); ...but it doesn't work - the value of…
B. Clay Shannon-B. Crow Raven
  • 8,547
  • 144
  • 472
  • 862
1
2 3 4