-----------------------------------------------------------
New Message on BDOTNET
-----------------------------------------------------------
From: gauravbisht2
Message 4 in Discussion
Hi
This is with ref to the question I posted on bdotnet.
About the second question:
In my datagrid, there is a field where users can enter the date. This entry is updated
whenever the update button is clicked, as is done in a normal data grid. The update
statement is executed by adding parameters to the query in the foll manner:
Dim parametertsd as OleDbParameter = new OleDbParameter("@tsd",OleDbType.VarWChar,75)
parametertsd.Value = TERT_SCR_DATE
myCommand.Parameters.Add(parametertsd)
I want to be able to update when the value of TERT_SCR_DATE is null too. This doesnt
seem to happen.
About the first bit of the prob I had:this is what goes in the edit statement. I
thought when the page is changed, the edit button would be able to pick out which row
in which page is calling the edit event. This doesnt seem to happen :-(
Sub dgResults_Edit(Src as Object, e as DataGridCommandEventArgs)
dgResults.EditItemIndex = e.Item.ItemIndex
BindData()
End Sub
This is the code for my paging event:
Sub dgResults_PageIndexChanged( s as Object, e As DataGridPageChangedEventArgs)
intStartIndex = (e.NewPageIndex * dgResults.PageSize)
dgResults.CurrentPageIndex = e.NewPageIndex
dgResults.EditItemIndex = -1
BindTheGrid()
End Sub
this is the code for Binding the data:
Sub BindTheGrid()
Dim dadResults As OledbDataAdapter
Dim dstResults As Dataset
intEndIndex = intStartIndex + dgResults.PageSize
strSelect = "Select * From TERT_SCREEN_DATA WHERE PRIM_REC_NO >@startIndex " & _
"And PRIM_REC_NO <= @endIndex Order By PRIM_REC_NO"
dadResults = New OledbDataAdapter(strSelect,condb)
dadResults.SelectCommand.Parameters.Add("@startIndex",intStartIndex)
dadResults.SelectCommand.Parameters.Add("@endIndex",intEndIndex)
dstResults = New DataSet
dadResults.Fill(dstResults)
dgResults.DataSource = dstResults
dgResults.DataBind()
End Sub
Somehow I need to make the edit event recognise the page its been called from .
Any inputs woudl be very very much appreciated
Thanks
Swati
----Original Message Follows----
From: "Pradeep Murti" <[EMAIL PROTECTED]>
Reply-To: "BDOTNET" <[EMAIL PROTECTED]>
To: "BDOTNET" <[EMAIL PROTECTED]>
Subject: Re: Custom paging, insertion of nulls
Date: Mon, 21 Jul 2003 06:52:52 -0700
Are you Unmarried? Register in India's No 1 Matrimony
-----------------------------------------------------------
To stop getting this e-mail, or change how often it arrives, go to your E-mail
Settings.
http://groups.msn.com/bdotnet/_emailsettings.msnw
Need help? If you've forgotten your password, please go to Passport Member Services.
http://groups.msn.com/_passportredir.msnw?ppmprop=help
For other questions or feedback, go to our Contact Us page.
http://groups.msn.com/contact
If you do not want to receive future e-mail from this MSN group, or if you received
this message by mistake, please click the "Remove" link below. On the pre-addressed
e-mail message that opens, simply click "Send". Your e-mail address will be deleted
from this group's mailing list.
mailto:[EMAIL PROTECTED]