.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

Help Moving Datagrid items with Up and Down arrows!!

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


I need some help.  I have a datagrid that has photos and a description of the individual in the photo.  I have a procedure that works and if I execute it with the correct parameters it changes the rows in the table.  I have a datagrid with two image buttons, MoveUp and MoveDown.  I just want to be able to reorder the photos when needed.

In my proc called "MoveMember" I have these parameters that are passed in.  The column that gets swapped in my table is the "OrderBy" column, they are just numeric numbers 1,2,3,4 etc.

So in my procedure 2 and 3 can be interchanged. 

@FMFacultyID INT,
@FMFirstOrderBy INT,
@changeValue INT,
@FMSecondOB INT 

View Complete Post

More Related Resource Links

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

Adding items to ObservableCollection via DataGrid

Hi All, I have a DataGrid bound to an ObservableCollection. I'd like to be able to add objects to the collection via the Grid. When I was working with sample data, I could go to the bottom of the grid, hit enter and add a new entry. Now that I'm using real data I don't seem to be able to do that. I tried taking a look at the class that the SampleData creates and can't quite fathom what it's up to. Does anyone know what I'm missing \ what I need to implement to make this possibe? Thanks Warrick

DropDownList in the FooterTemplate of a DataGrid will not show its items


I am placing a dropdown list in the footer of a DataGrid like this:

<asp:DataGrid id="MyGrid" runat="server">
            <asp:DropDownList ID="myDDL" OnLoad="myDDL_OnLoad" runat="server" />

In my code behind file, in the myDDL_OnLoad event handler, I call to the database, populate a SqlDataReader, and set the DDL's datasource to that datareader. I define what data columns should be used for the DataValueField and DataTextField of the dropdownlist. Then I call the DropDownList's DataBind() method. Everything works without error. But, when the dropdownlist is displayed, it has blank lines in it.

By that, I mean if 8 records are loaded into the dropdownlist, it will expand to a size appropriate for 8 rows but, it will be empty. there is no text in it.

Has anyone seen this type of behavior before? This dropdownlist is in the footer of a dynamically loaded ajax update panel so, it is difficult to see the source code to see what values are in the html element rendered to represent the dropdown.

Thanks in advance for any advice you can give.

WPF DataGrid.Items.Refresh Exception


I am getting this exception when calling the Refresh method of a datagrid.items.  Any clue how to solve this?

This is the message:  'Refresh' is not allowed during an AddNew or EditItem transaction


Moving items from ListBox1 to ListBox2 using jquery


HIi guys,

I have two ListBoxes.I want to movie items from ListBox1 to Listbox2 using jquery.

I want to save ListBox2 items in Xml file.

But i am unable to get ListBox2 items after moving from ListBox2.

I searched for this problem.Solutions is Use HiddenField for getting server side.

I am new to Dot net.So Explain with one simple example.

Thanks all,

Rama krishna

Error moving items with Business data column


Hi people,

I'm trying to move items from a list with a business data column using the move option through content and structure manager but once the proccess are completed, in the destination list I recieve this error when try to add or edit elements: "Failed to retrieve data from a system". Even when i try to modify the business data column , i recieve this another error:"an error has ocurred".

I've tried this operation in two difer site collections and this error always ocurr, Is there a way copy or move list items with business data column, or this is a bug of the plataform?

Thanks and best regards, 


jQuery: Styling DropDownList Alternating Items (Rows)

In the following example, I will show how you can style any asp:dropdownlist very easily.

The example demonstrates how you can change alternating row items background color, using the fadeTo() to add a nice touch in the dropdownlist. You can change alt rows with a couple lines.

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.

Hide a repeater in ASP.NET C# if the DataSource contains no items?

I have an ASP.NET page that uses a repeater nested within another repeater to generate a listing of data. It's to the effect of the following:
In the (C#) code-behind I'm basically using LINQ to pull a listing of information from an XML document and bind that information to the first repeater.

Searching for the answer to this, it seems the method is to determine whether the data for the nested repeater is empty. If it is, then you set the visibility of the repeater to false.

Use Jquery with repeater, gridview, datagrid

Before we talk about jquery inside any itemtemplate (repeater, gridview, datagrid), we need to understand the basic use of jquery functions

ListBox tricky to set in a DataGrid/GridView

Listboxes are very tricky to set selected items in grid - there is no real nice way to do it. It would have been great if Microsoft included a property that accepts an array or comma separated values - or anything! But they only allow each item in the list to be selected individually. The way to do this in a grid is a bit messy, but it is fairly simple to implement. When a row is created (as per the event), select the items of the listbox as per the datagrid source data:

How to highlight datagrid or GridView row on mouse over?

This article will show how you can Ajax with GridView to display popup messages when mouse moves over certain column. In the demo project I have added first column as an image column with a help icon in it. This kind of implements a feature that if you want more information about the row you can move mouse over this icon, a asynchronous request is sent to server for data about that row and when call returns the returned message is show as a popup message.

Creating SharePoint items with CreateItemActivity

Instead of creating new list items from code in your workflow you can use CreateItemActivity. CreateItemActivity can be used for creating list items or files. Properties of interest for this activity are the following (most of them are self-explanatory):

Multiple Column Dropdownlist for the ASP.NET DataGrid

Based on my previous control "Multiple Column DropDownList for ASP.NET", I received many emails asking for the same control to be used in the DataGrid for web applications. Here we go.. This control can be used as the regular MS DropDownList in the DataGrid and also as a regular dropdownlist. It has all the properties, like DataTextField, DataValueField, DataSource, SelectedIndex etc. The download file contains the samples both in VB.NET and C#. In this sample, I have used the Northwind database of SQL Server.

Creating Sites/Lists/List Items under Current User Context in SharePoint By Using SPUserToken

Usually we do this by performing the action under RunWithElevatedPrivileges method and updating the listitem using SPListItem.SystemUpdate() method (see here). but this approach has its own flaws like (RunWithElevatedPrivileges will run under system account, we cannot use SystemUpdate for SPSite,SPWeb,SPList, since it runs under system we will "CreatedBy" by as SystemAccount).

HttpContext.Items and Server.Transfer/Execute

The problem was basically that when a Server.Transfer call was applied the script container (and also various ClientScriptProxy script embedding routines) would potentially fail to load up the specified scripts.

Using the WPF Toolkit DataGrid

WPF comes with a large number of built in controls, but from the beginning it has lacked something that many application developers find extremely important - a DataGrid. You can use the ListView to create something approximating a 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