.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
Gaurav Pal
Post New Web Links

Iterate the rows in the datagrid and compare it with the systemclock

Posted By:      Posted Date: September 29, 2010    Points: 0   Category :ASP.Net


How would I iterate the rows in the datagrid? The 4th column contains the time, I would like to compare it with the systemclock and enter "ACTIVE" in the 5th column if the time value in the 4th column is equal to the system clock?

I tried FOR EACH.. but I can't get it right.. Please help.

View Complete Post

More Related Resource Links

iterate throw rows of Template Column in Datagrid



I am using WPF DataGrid (VS 2008). i am using Template column with a button in it i want to change the content of the button(Caption) when it is clicked .i am doing it in its click event ,but it  changes the content of only the button clicked(only one row). i want to change the content of button in all rows.

how can access the button instance of all rows in this template column.



How to format and update GridView and DataGrid rows using JQuery

The behavior described in this question is as expected. When you set text of a cell in grid, it directly affects HTML that is going to be rendered. When you set text value of a cell, it means that you are setting innerText of the cell. The column that GridView creates for command fields (Edit, Delete and Select) are a (anchor) or button elements. So you can see what will happen if you set text value in that cell. It will wipe out those link or button controls and replace them with simple text string.

Cutting Edge: Moving DataGrid Rows Up and Down


Imagine opening your Inbox one morning and finding a message that reads "Dear Mr. DataGrid, I urgently need an ASP.NET DataGrid that lets my users move rows on the client. You're my last hope. Will you please help me?"

Dino Esposito

MSDN Magazine March 2005

How to have all rows of a datagrid editable (ASP.NET 1.1)

HelloI have a datagrid and I would like to know if there is a way to make all rows editable, currently now I have the user selecting a checkbox on the leftmost column that makes the row editable (using the EditItemIndex property). Thanks, 

Iterate through rows of dataset in report's custom code

Hello, How can I iterate through the rows of a dataset in the custom code? I have a report containing a dataset. I pass the dataset as a parameter to the custom code function. But what then? Where is a reference about the available members etc.? Here is my dummy sample code so far: Public Function ShowParameterValues(ByVal ds as DataSet) as object() Dim codes() As Object Array.Resize(codes,dc.???.Count) codes(0)=ds??(field???)(row??) return codes End Function As the task I want to accomplish is very simple, I want to keep it in the custom code instead of writing any custom assemblies etc.   Thank you!

ASP.NET Events and Pageload not firing when Datagrid containing large number of rows of data

Hi All, I have a datagrid in aspx page.Inside of datagrid i am using around 15 controls such as Button,dropdownlist and text box controls.Once the datagrid binds then the events in the aspx page not firing.Issue occured when the number of rowsgreater than 500.The number of rows less then its works fine.If anybody knows the solution please let me know."Platform i am working on ASP.NET1.1"Regards Hareesh

How to sum a column in a datagrid for just the multiselected rows?

I have a WPF4 datagrid, populated via linq to sql, which has some numeric fields. How do I sum the value of one of these fields for just the selected rows? (multiselect is turned on)  

Showing thousands of rows in datagrid, need cursor to wait while loading rows

I´m creating DataGrid columns dynamicly in C# and loading data into a list at the same time. Cursor is waiting at the same time. Now, after columns are created and data is loaded into a list. I set the myDataGrid.Itemssouce = mylist; Cursor=Curosrs.Arrow; Andafter that, I set the Cursor to arrow again as you can see. But when the list contains thousands of rows it takes about 5-10 seconds for the datagrid to show the rows. Its ok but I need the cursor to be in waiting stage allso while data is not shown but the cursor is not waiting, its arrow. Any suggestions, please?

Adding new rows to Datagrid with a Combobox column generate "two-way binding requires path or xpath"



    I have datagrid control with a template combobox column like:

 <DataGridTemplateColumn Header="Fault code" Width="75">
                                    <TextBlock Text="{Binding FaultCode1}" />

WPF Datagrid SelectionChanged event is triggering Multiple times while loading the rows.



When i use DataGridComboBoxColumn in my WPF DataGrid, the DataGrid SelectionChanged event is triggering multiple times based on the number of rows while loading the rows in the WPF DataGrid.

How can i stop this? Because of this I am facing Performance issue.



Please remember to click "Mark as Answer" on the post that helps you, and to click "Unmark as Answer" if a marked post does not actually answer your question. This will help other members to find the solution easily.

compare rows in gridview



i have a gridview with check box in it and I also have a button separately.

The gridview contains students name and their school name.

User will select rows in gridview with the check box and click the button.

Now what I want is, if user select students from two different school, system will display message ("wrong selection").

But if user select student with in the same school, system will work as it should be.

so, how can I compare the rows?? any help??

WinForms: Filling Rows in DataGrid Using Threading and yet gridcontrol should be responsive.


WinForms Application. C#, .NET 3.5.


I have a function with searchs data into a non RDBMS Source, collects data and Inserts each found records into DataSet and finally it returns DataSet to main module.  The main module binds returned Dataset to WinForms Grid Control.  When user click on any row, it should display details of selected row.

The search takes quite long time and hence i want to use threading such that as the function find the data it returns the data to main module and main module adds the data into a DataSet object which will be already binded to Grid Control. The Grid control should automatically refresh itself as he finds new data in its underlying databset.  While search is going on the Grid control should remain responseive so that when user clicks on any row, I can call anothr function to retrieve details of the selected row.

I tried using BackgroundWorker still the UI freezes. I observe the grid control does not refresh itself and is non-responsive.

Please guide on how to achieve this and I would really like if there is any sample on similar lines with GridControl.







Datagrid Read Only Rows


Hi All, I wonder if I could pick your brains.

I have a wpf datagrid and want to make ROWS disabled/read only if a certain value is in the row. i.e. Date Approved present therefore row cannot be edited.

Is that possible? Many thanks Scott

programmatically add/edit datagrid rows



I'm new to WPF, and I'd like to add rows with data at runtime, and edit data manually in a DataGrid, just as it was possible to do with the WinForms DataGridView.

WPF DataGrid control is really awesome, but lacks some simplicity and generality of WinForms, like unbound data...

Can someone please give me a hint?



Drag & Drop expander group / rows in datagrid



I am wondering how I can find some help, sample about reordering datagrid rows by using drag & drop feature.

In my case, I have a grid (.NET 3.5 gridview in a listview or WPF Toolkit Datagrid) bound to a CollectionViewSource with 2 propertyGroupDescriptions (Category/Sub category)

I need to be able to reorder rows either by using drag & drop on rows or on group descriptions (represented by expanders)

I've past my day with my friend google to find some info, but without any success...:(

Someone have already done this ?

By advance, thank you for your help


how to compare rows



I'm writing a query to produce a final report based on the number of days  product stays on the floor with the following logic:

1) if datediff  between r and s for the  same ctrl# is < = 5 then the charge is 0 and the remaining balance (if any) is a subject to a charge

2) if datediff between r and s for the same ctrl# is  > 5 then r is  subject to a charge and any  s > 5 is ignored

sample data set below, suggestions would be greatly appreciated!

ctrl# W date

Delete Datagrid Rows

One of the question which was asked on the silverlight forum was how to delete multiple rows of the datagrid when you have provided the checkboxs in the datagrid for the selection of more then one row in the datagrid.
ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend