You use your earlier code.That is rebind the grid after changing the page index and insert breakpoints .Check whether control is passing correctly or not.
chandralekha
Posts
-
griddview pageIndexChanged() event -
onrowclick of gridviewhi, For disabling row click on one of the columns ,you can give an if condition on onrowclick event as below If (e.ColumnIndex = 0) then else End if In the else case you can write the code for that event. Hope this will help you
-
griddview pageIndexChanged() eventIn page Index Changing no need to rebind gridview. Only this much is enough grdvwUpdt.PageIndex = e.NewPageIndex;
-
website losed TabIndex orderI think you have to check the entire application once again in local and try any exceptions are going or not.
-
website losed TabIndex orderHi, You can set the TabIndex of each controls according to the order.
-
ListBox Not Functioning.....Multiple SelectionFor that instead of assigning values directly to textbox,first you store values to a string array.And after that you create other loop and assign values to your textboxes. Hope this will help you
-
datagridviewFor doing that in the DataAdapter you add a column.Let its name be sno.Then you change the autoincrement property of that column to true.Set auto incrementSeed as a number(For ex: 0) from which number you want to start numbering.Change datatype to System.Int64. While binding the datagrid with that adapter the column numbers will come..
-
Dynamic control add in form and finally store in to databaseFor adding textboxes dynamicaly into a form you can either add textbox controls to a form directly or to a placeholder control inside the form.For retriving values correctly i suggest you to place controls inside a placeholder. You want to create 3 Textboxes in each link button click.Here what i had done is I placed a dropdownlist with items 1,2,3 ..etc.According to the selected item value of the dropdownlist that much set of 3 Textboxes is generated. For that first I place a DropDownList1,PlaceHolder1 and Button1 in the form. My code follows protected void Page_Load(object sender, EventArgs e) { for (int i = 0; i < Convert.ToInt16(DropDownList1.SelectedItem.Text); i++) { PlaceHolder p2 = new PlaceHolder(); p2.ID = "p2" + i; PlaceHolder1.Controls.Add(p2); for (int j = 0; j < 3; j++) { TextBox tb = new TextBox(); tb.ID = "TextBoxg"+i + j; p2.Controls.Add(tb); RequiredFieldValidator f1 = new RequiredFieldValidator(); f1.ControlToValidate = "TextBoxg" + i+j; ; f1.ErrorMessage ="*"; p2.Controls.Add(f1); p2.Controls.Add(InsertBreaks(1)); } p2.Controls.Add(InsertLineBreaks(2)); } } private static Label InsertBreaks(int breaks) { Label lblBreak = new Label(); for (int i = 0; i < breaks; i++) { lblBreak.Text += " "; } return lblBreak; } private static Label InsertLineBreaks(int breaks) { Label lblLineBreak = new Label(); for (int i = 0; i < breaks; i++) { lblLineBreak.Text += "
"; } return lblLineBreak; } protected void Button1_Click(object sender, EventArgs e) { string[] data = new string[3]; foreach (Control c in PlaceHolder1.Controls) { int yu = 0; foreach (Control c23 in c.Controls) { if (c23.GetType().ToString().Equals("System.Web.UI.WebControls.TextBox")) { data[yu] = ((TextBox)c23).Text; yu = yu + 1; } } //data[0], data[1], data[2] will contain the datas of each row. //Here you can give your insert command to the database -
set the selected value for drop down from a database query (VB.NET)You can select the needed value from the database.If DropDownList1 be the dropdownlist which contain the values a,b,c,d.You can make the selected item of the dropdownlist as that value.If you used a DataReader to retrive the data from database DropDownList1.SelectedItem =dr(0).ToString() where dr is my DataReader Hope This Code Help You
-
How to add a button column to the datagrid using vb.net2003For Adding a button to a datagridview first you add a button column to the columns collection.For example I created a buttoncolumn with name "Button".In the column properties i give the text of that column as "Button" and change the property "Use column text For Button Value" as true. In the DataGridView1_CellClick event write the code below Private Sub DataGridView1_CellClick(ByVal sender As System.Object, ByVal e As System.Windows.Forms.DataGridViewCellEventArgs) Handles DataGridView1.CellClick If DataGridView1.Item(e.ColumnIndex, e.RowIndex).Value Is "Button" Then MsgBox(DataGridView1.Item(1, e.RowIndex).Value) Me.Visible = False Dim obj As New Form2 obj.Show() obj.TextBox1.Text = DataGridView1.Item(1, e.RowIndex).Value End If End Sub DataGridView1.Item(1, e.RowIndex).Value gives that rows 1st column value.You can use any column of that rows value for the unique identification of that row.Here I passed that value to a TextBox in Form2. In Form2 with respect to that value you can display the needed informations. Hope this information clear your doubt.
-
Can i add the database item to drop down listI think your update form's city dropdownlist and country dropdownlist contains list of city and country.And you want the particular city and country to come as selected. For that by using the select query you take the value to the form.You assign that to a string variable.For example the city value is assigned to strCity and country to strCountry.If the city's dropdownlist is DropDownList1 and country's is DropDownList2. Then you can use the following code if (DropDownList1.Items[0].Text == strCity) { DropDownList1.SelectedItem.Text =strCity; } else { DropDownList1.Items.Insert(0, strCity); } if (DropDownList2.Items[0].Text == strCountry) { DropDownList2.SelectedItem.Text =strCountry; } else { DropDownList2.Items.Insert(0, strCountry); } Hope This Code Help You