gridview

ASP.NET Grid View Add new row

I'm just starting to use the ASP.NET GridView control. i was thinking of adding an "Add New Row" button to the Footer to add a new data row to the grid. Initially, I want the grid to be empty, with only a footer row displayed. however, if there are no data rows, the whole grid doesn't appear and there is no way to add first row since...

Does GridView automatically append values “ASC” or “DESC” to the value of sortExpression parameter?

When GridView implements sorting, does it automatically append string values “ASC” or “DESC” to the value of sortExpression parameter? If so, then based on what criteria does it “decide” when to append “ASC” and when to append “DESC” value? ...

How to change the direction of a BoundField in GridView

Hello you all , Sorry if my question seems to simple . Right now in the BoundField of my GridView some data display like "12/11/1381" that i wanna display like "1381/11/12" (opposite direction) . I know i could change the direction via rtl and ltr in TemplateField. But because of some reason i can't convert my boundfield to templatef...

Using Validation controls with a GridView

A typical situation: In my GridView control, I have a Footer row which contains a Textbox and an "Add" Button. When the button is pushed, the Text entered in the TextBox is added to the grid. I also have a validation control to require that, when the button is pushed, that text has been entered in the TextBox. After a new row is added, ...

Changes HTML attr with inline scripting

Hello Everyone, I was trying to do this : <asp:GridView ID="gvBugList" runat="server" AutoGenerateColumns="False" ShowHeader="False" DataSourceID="linqDSBugList" Width="100%" AllowPaging="true" PageSize="20" DataKeyNames="BugID"> <Columns> <asp:TemplateField> <ItemTemplate> <div class="messag...

C# Sending GridViews/DataTables via Email

I'm trying the find the best way to send a GridView or DataTable in an email. Page Behind Code: protected void Page_Load(object sender, EventArgs e) { DataTable s1 = Sql.specificReportData(Convert.ToInt32(Session["userID"])); this.gv.DataSource = s1.DefaultView; this.gv.DataBind(); } This generates and binds the data successfully, bu...

Find the status of Checkbox in Grdiview with paging

Hello All, This is the code that i use to find whether any checkbox is checked in gridview if($("table tr td:first-child input:checkbox:checked").length ==0) { alert("Select atleast one event to delete");return false ; } if(confirm('Are you sure! you want to delete the selected events(s)?')) return true; else retur...

Is custom paging of GridView (in ASP.NET, preferably 3.5) possible without using ObjectDataSource?

See title. Using ObjectDataSource is associated in my mind with quick demos that you can see at conferences and in video tutorials (which typically tells me "don't do it this way in production"). Also I always like to have control over what's going on and when it happens. My other problem with ObjectDataSource is that is's declarative. ...

Tooltip in gridview

Hello all...complete novice at work (who is also ill and feeling particularly thick) I have the following code that gives me a generic "tool tip text" for each heading in a gridview....great. protected void GridView1_RowDataBound(object sender, GridViewRowEventArgs e) { if (e.Row.RowType == DataControlRowType.Header) { ...

GridView SelectedIndexChange with Try Catch Block faulty in 2.0?

I am using ASP.NET 2.0. When i place a TRY CATCH block in my event it always go into the CATCH section, in my case it re-direct the page to Default.aspx. But if I remove the TRY CATCH block the code get's executed fine and it does what it suppose to. Protected Sub gridResults1_SelectedIndexChanged(ByVal sender As Object, ByVal e As Sys...

telerik radgrid: grid clientside pagination

I have a web service which returns me some data,I am massaging this data and using this as datasource for my radgrid (telerik). The datasource is quite large, and would like to paginate it. I found couple of problems when I paginate it in the server side I have to bind the grid again for pagination, which essentially means I have to ma...

Tooltip in gridview using dictionary method

Evening all. I have the following code that I need looking into - basically I'm clutching at straws here. I have a gridview that I would like to assign tooltips to. protected void GridView1_RowDataBound(object sender, GridViewRowEventArgs e) { if (e.Row.RowType == DataControlRowType.Header) { foreach (...

how to sort in gridview using template fields

The sorting works fine when u fill the gridview using SQL datasource in the aspx page... but now i am using template field and the columns are filled separately in the codebehind and the sorting is not working... my code is <asp:GridView ID="GridView1" runat="server" AllowSorting="True" AutoGenerateColumns="...

ASP.NET/C# Linq Binding to GridView

I group my data by length as follows int[] a = { 1, 2, 3,45,45,100,566}; var result = a.GroupBy(x => x.ToString().Length). Select(d => new { Key = d.Key, Grp = d }); My BulletedList is nested in GridView(placed as template field) to display the items,What is the way to bind the BulletedList when GridView displays "Key". GridView...

How to fill a dataset after getting a gridview?

I have a gridview which has many columns.. the columns are got separately and displayed in a gridview. now i need to sort this gridview but i cannot do that.... i have found a way but i will need to get the gridview in a datatable or a dataset.... is there a a way to do this? DataSet ds= new DataSet(); ds = Gridview1.???? please help...

Making Flash video behave nicely in IE

So I'm trying to make Flash video work at http://skadaddlemedia.com/beta/blog/ and http://skadaddlemedia.com/beta/about/. Things are going swimmingly in Safari and Firefox. Not so in IE. I completely expect this is due to my Flash incompetence. Can anyone help me see where things are going wrong? I'm attempting different methods to inp...

Delete records using LinQ

Hello, I have a gridview in asp.net page where I am allowing users to update data in the gridview with textboxes and dropdownlist. When a user hits submit button I am trying to delete existing records and insert new records When I try the below mentioned code it is throwing out errors. Right now I am not infront of the dev box thats th...

get the value of date picker used in gridview

i have create dynamic datepicker inside gridview. i want to know how to get the values of the datepicker help me out!! i have used this line DateTime date2 = DateTime.Parse(((TextBox)Gridview1.Rows[rowIndex].Cells[3].FindControl("frmdate_endtime")).Text); ...

ASP.NET LINQ with Databinding

I have a collection of books as static public Book[] Books = { new Book { Title="Funny Stories", Publisher=Publishers[0], Authors=new[]{Authors[0], Authors[1]}, PageCount=101, Price=25.55M, PublicationDate=new DateTime(2004, 11, 10), Isbn="0-000-77777-2", Subject=...

Editable Gridview with code behind data source from ODBC

Hey guys, I am trying to make a small gridview that lists the results of a query against a non standard SQL db, and with this information I want the user to be able to edit a column or two to update the data in the db. I know this is easy with an sqldatasource control but I lack that luxury and I am having trouble switching from my item...