This is a discussion on Create control according to their data type within the .Net Development forums, part of the Programming & Scripting category; with above problem now i want to save that values in database also.so any direction is appreciated....
| |||||||
|
#31
| ||||
| ||||
| with above problem now i want to save that values in database also.so any direction is appreciated.
__________________ Love is physical attraction and mental destruction |
|
#32
| ||||
| ||||
| Here's how I handle the paging: First, create a property: Code: public int CurrentPage {
get {
if (string.IsNullOrEmpty(ViewState("currentPage"))) {
return 1;
}
else {
return (int)ViewState("currentPage");
}
}
set { ViewState("currentPage") = value; }
}
Code: {
PagedDataSource pgdSource = new PagedDataSource();
{
pgdSource.DataSource = yourdatasource;
pgdSource.AllowPaging = true;
pgdSource.PageSize = 20;
pgdSource.CurrentPageIndex = (CurrentPage - 1);
}
}
__________________ jmurrayhead If you agree with me... click the icon! If my post solved your problem, click the button in the lower right-hand corner of the post.If you like it here...throw us a few bones to help support us. Join our Folding team: DeveloperBarn Folding |
|
#33
| ||||
| ||||
| I believe the paging is sorted J. As I understand it, the issue is, if you change a textbox or dropdown on page 1 and then go to page 2, when you go back to page 1, the new details you entered aren't saved. It's these changes guddu needs to keep. I would assume the best way would be to update the db when the page changes?
__________________ Join the folding team |
|
#34
| ||||
| ||||
| Then the values and ID's of each control would have to be stored in viewstate as well. Then, when a page is clicked, during that event you would have to check if there is a value for the id in viewstate and then set the value of the control to the value in viewstate. The same concept is used here with CheckBoxes: Maintaining Checkbox State in a Listview |
|
#35
| ||||
| ||||
| hey can give me link which used c# for this purpose. |
|
#36
| ||||
| ||||
| |
|
#37
| ||||
| ||||
| huh.during conversion i m getting error for below code line 1 col 11: invalid NonModuleDeclaration Code: Protected Sub AddRowstoIDList()
' Loop through all the current items in the Listview
For Each lvi As ListViewDataItem In ListView1.Items
' Find the checkbox in each row
Dim chkSelect As CheckBox = CType(lvi.FindControl("chkSelect"), CheckBox)
' If the checkbox is ticked then add the corresponding ID to our private list
If (Not (chkSelect) Is Nothing) Then
' Get the ID from the datakeynames property
Dim ID As Integer =
Convert.ToInt32(Listview1.DataKeys(lvi.DisplayIndex).Value)
If (chkSelect.Checked AndAlso Not Me.IDs.Contains(ID)) Then
' Add the ID to our list
Me.IDs.Add(ID)
ElseIf (Not chkSelect.Checked AndAlso Me.IDs.Contains(ID)) Then
' Not checked - remove the ID from our list
Me.IDs.Remove(ID)
End If
End If
Next
End Sub
|
|
#39
| ||||
| ||||
| can u tell me how to convert this line Code: ' Get the ID from the datakeynames property
Dim ID As Integer = Convert.ToInt32(Listview1.DataKeys(lvi.DisplayIndex).Value)
|
![]() |
|
| Bookmarks |
| Thread Tools | |
| Display Modes | |
| |
| ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Create/Print Form data | Rebelle | ASP Development | 5 | December 10th, 2008 10:25 AM |
| Binding data to the RadioButtonList Control | Shem | .Net Development | 2 | December 3rd, 2008 02:42 AM |
| The data source 'ObjectDataSource1' does not support sorting with IEnumerable data | Shem | .Net Development | 5 | June 25th, 2008 08:07 AM |
| Data Type Mismatch in Criteria Expression | alansidman | Microsoft Access | 1 | April 9th, 2008 04:33 PM |
| [Error] Type mismatch: HTMLEncode | Rebelle | ASP Development | 20 | March 28th, 2008 09:30 AM |