Telerik Forums
UI for ASP.NET AJAX Forum
1 answer
65 views
Hi,

I am using the FormTemplate mode in EditForm settings.
When the user fills information in new item and clicks on 'Save' it fires the perfomInsert command.
I am validating data in ItemCommand method in code behind.

When the validation is successful I am rebinding the grid. Otherwise I need to display error message to user and user should still see the InsertItem. But as soon as the execution of code in 'PerformInsertCommand' completes, the new InsertItem is hidden.

How do I get around this?

Brindavan
Daniel
Telerik team
 answered on 26 Feb 2009
3 answers
554 views

Hi,
I am using radgrid to list all the records. I am using nested tables i.e. telerik:GridTableView. There is one  RadComboBox in first column of DetailTables(Nested table under mastertable). I want to set some value in second column of same row which is depend upon selecteditem of RadComboBox.

I can call the javascript function on selectedindexchanged event of RadComboBox. But I am not getting the cell of the radgrid in the same row of the RadComboBox of which client side event is occured.
 
I am not able to get cell of the DetailTables under radgrid. How can I set the value in to that cell which is in the same row as that of RadComboBox?

Thanks,
Vinayak Chavan.

Princy
Top achievements
Rank 2
 answered on 26 Feb 2009
1 answer
113 views
Is there anyway to stop a user from clicking on the same linkbutton 2,3,4 times that executes a very long SQL operation?

Basically, the SQL operation behind the linkbutton is taking some time to complete and users will click this button more than once before the SQL operation completes. It is a DELETE Operation and does an implicit ReBind. But before the ReBind occurs to remove the row from the grid the user may have clicked it serveral times already....causing an error.

The desired behavior would be to not  allow the RadGrid.DeleteCommandName to fire if this operation was already in progress.

Private

Sub RadGrid1_ItemDataBound(ByVal sender As Object, ByVal e As Telerik.Web.UI.GridItemEventArgs) Handles RadGrid1.ItemDataBound

 


If

TypeOf e.Item Is GridDataItem Then

 

 

Dim dataItem As GridDataItem = CType(e.Item, GridDataItem)

 

 

' create custom delete prompt

 

 

Dim classnametext As String = dataItem("NAME").Text

 

 

Dim button As LinkButton = CType(dataItem("column").Controls(0), LinkButton)

 

button.Attributes(

"onclick") = "return confirm('Are you sure you want to delete class: " & classnametext & " ?')"

 

 

End If

End Sub 


 

 

Private Sub RadGrid1_ItemCommand(ByVal source As Object, ByVal e As Telerik.Web.UI.GridCommandEventArgs) Handles RadGrid1.ItemCommand

 

 

' supress columns in Edit-Mode for the following STATUS' OPEN-CLOSED

 

 

 

 

If ddlClassStatus.SelectedValue = "Open" Or ddlClassStatus.SelectedValue = "Closed" Then

 

 

 

 

Dim firstColumn As GridEditCommandColumn = CType(e.Item.OwnerTableView.GetColumnSafe("EditCommandColumn"), GridEditCommandColumn)

 

 

If (e.CommandName = RadGrid.EditCommandName) Then

 

 

 

 

' create custom EditRecord link

 

 

 

 

Dim dataItem As GridDataItem = CType(e.Item, GridDataItem)

 

 

Dim linkButton As LinkButton = New LinkButton

 

 

' supress columns in Edit-Mode for the following STATUS' OPEN-CLOSED

 

 

 

 

If ddlClassStatus.SelectedValue = "Open" Or ddlClassStatus.SelectedValue = "Closed" Then

 

 

 

dataItem(

"EditCommandColumn").Text = "<br>"

 

 

 

 

End If

 

 

 

 

End If

 

 

 

 

End If

 

 

 

 

' delete class and all associated data

 

 

 

 

If (e.CommandName = RadGrid.DeleteCommandName) Then

 

 

 

 

 

' determine class status

 

 

 

 

Dim _classid As String = e.Item.OwnerTableView.DataKeyValues(e.Item.ItemIndex)("CLASSID").ToString()

 

 

 

Dim connectionString As String = ConfigurationManager.ConnectionStrings("HRregistrationConnectionString").ToString

 

 

Dim SqlConnection As New SqlConnection(connectionString)

 

 

Dim SqlCommand As New SqlCommand

 

 

Dim SqlStatement As New StringBuilder

 

 

Dim SqlLookupStatement1 As String

 

 

 

 

Dim SqlLookupStatement2 As String

 

 

 

 

Dim SqlLookupStatement3 As String

 

 

 

 

Dim SqlLookupStatement4 As String

 

 

 

 

Dim SqlLookupStatement5 As String

 

 

 

 

Dim SqlLookupStatement6 As String

 

 

 

 

Dim SqlLookupStatement7 As String

 

 

 

 

Dim SqlLookupStatement8 As String

 

 

 

 

Dim SqlLookupStatement9 As String

 

 

 

 

Dim RecordsAffected As Integer

 

 

 

 

'Open the SqlConnection

 

 

 

SqlConnection.Open()

 

' put this in a transaction

 

 

 

 

Using txn As SqlTransaction = SqlConnection.BeginTransaction

 

 

Try

 

 

 

 

' lookup the CLASSSTATUS.STATUSTYPEID

 

 

 

 

Dim _statustypeid As String

 

 

 

SqlLookupStatement1 =

"SELECT STATUSTYPEID FROM DBO.CLASSSTATUS WHERE CLASSID = '" + _classid + "'"

 

 

 

SqlCommand.CommandText = SqlLookupStatement1

SqlCommand.Connection = SqlConnection

SqlCommand.Transaction = txn

_statustypeid = System.Convert.ToString(SqlCommand.ExecuteScalar)

 

 

' lookup the CLASSES.NAME

 

 

 

 

Dim _name As String

 

 

 

SqlLookupStatement2 =

"SELECT NAME FROM DBO.CLASSES WHERE CLASSID = '" + _classid + "'"

 

 

 

SqlCommand.CommandText = SqlLookupStatement2

SqlCommand.Connection = SqlConnection

SqlCommand.Transaction = txn

_name = System.Convert.ToString(SqlCommand.ExecuteScalar)

 

 

' lookup the STATUSTYPE.STATUSCODE

 

 

 

 

Dim _statuscode As String

 

 

 

SqlLookupStatement3 =

"SELECT STATUSCODE FROM DBO.STATUSTYPE WHERE STATUSTYPEID = '" + _statustypeid + "'"

 

 

 

SqlCommand.CommandText = SqlLookupStatement3

SqlCommand.Connection = SqlConnection

SqlCommand.Transaction = txn

_statuscode = System.Convert.ToString(SqlCommand.ExecuteScalar)

 

 

If _statuscode = "Open" Then ' class [Open] being deleted -- notify enrolled users and Admins of cancellation

 

 

 

 

'lookup the CLASSES.DATE

 

 

 

 

Dim _date As String

 

 

 

SqlLookupStatement7 =

"SELECT DATE FROM DBO.CLASSES WHERE CLASSID = '" + _classid + "'"

 

 

 

SqlCommand.CommandText = SqlLookupStatement7

SqlCommand.Connection = SqlConnection

SqlCommand.Transaction = txn

_date = System.Convert.ToString(SqlCommand.ExecuteScalar)

 

'lookup the CLASSES.STARTIME

 

 

 

 

Dim _starttime As String

 

 

 

SqlLookupStatement4 =

"SELECT STARTTIME FROM DBO.CLASSES WHERE CLASSID = '" + _classid + "'"

 

 

 

SqlCommand.CommandText = SqlLookupStatement4

SqlCommand.Connection = SqlConnection

SqlCommand.Transaction = txn

_starttime = System.Convert.ToString(SqlCommand.ExecuteScalar)

 

'lookup the CLASSES.ENDTIME

 

 

 

 

Dim _endtime As String

 

 

 

SqlLookupStatement5 =

"SELECT ENDTIME FROM DBO.CLASSES WHERE CLASSID = '" + _classid + "'"

 

 

 

SqlCommand.CommandText = SqlLookupStatement5

SqlCommand.Connection = SqlConnection

SqlCommand.Transaction = txn

_endtime = System.Convert.ToString(SqlCommand.ExecuteScalar)

 

'lookup the CLASSES.LOCATION

 

 

 

 

Dim _location As String

 

 

 

SqlLookupStatement6 =

"SELECT LOCATION FROM DBO.CLASSES WHERE CLASSID = '" + _classid + "'"

 

 

 

SqlCommand.CommandText = SqlLookupStatement6

SqlCommand.Connection = SqlConnection

SqlCommand.Transaction = txn

_location = System.Convert.ToString(SqlCommand.ExecuteScalar)

 

'lookup the CLASSES.DESCRIPTION

 

 

 

 

Dim _description As String

 

 

 

SqlLookupStatement8 =

"SELECT DESCRIPTION FROM DBO.CLASSES WHERE CLASSID = '" + _classid + "'"

 

 

 

SqlCommand.CommandText = SqlLookupStatement8

SqlCommand.Connection = SqlConnection

SqlCommand.Transaction = txn

_description = System.Convert.ToString(SqlCommand.ExecuteScalar)

 

 

' user list

 

 

 

SqlLookupStatement3 =

"SELECT REGISTEREDUSER.NAME, REGISTEREDUSER.EMAILADDRESS FROM DBO.REGISTEREDUSER INNER JOIN REGISTRATIONSTATUS ON REGISTEREDUSER.REGISTEREDUSERID = REGISTRATIONSTATUS.REGISTEREDUSERID INNER JOIN STATUSTYPE ON REGISTRATIONSTATUS.STATUSTYPEID = STATUSTYPE.STATUSTYPEID WHERE (REGISTRATIONSTATUS.CLASSID ='" + _classid + "' AND STATUSTYPE.STATUSCODE ='Enrolled')"

 

 

 

SqlCommand.CommandText = SqlLookupStatement3

SqlCommand.Connection = SqlConnection

SqlCommand.Transaction = txn

 

' prepare data adapters/rows

 

 

 

 

Dim da_email_user As New SqlDataAdapter(SqlCommand)

 

 

Dim ds_email_user As New DataSet

 

 

Dim row_email_user As DataRow

 

 

Dim _emailaddress As String

 

 

 

 

Dim _username As String

 

 

 

 

Dim _userlist As New StringBuilder

 

da_email_user.Fill(ds_email_user)

 

For Each row_email_user In ds_email_user.Tables(0).Rows

 

_emailaddress = row_email_user(

"EMAILADDRESS")

 

_username = row_email_user(

"NAME")

 

 

' send Cancellation e-mail

 

 

 

SendCancellationEmail(_emailaddress, _name, _username, _date, _starttime, _endtime, _location, _description)

 

' create affected user list

 

 

 

_userlist.AppendLine(_username)

 

Next

 

 

 

 

' reset sql statement

 

 

 

SqlStatement.Remove(0, SqlStatement.Length)

RecordsAffected = 0

 

 

' wait list

 

 

 

SqlLookupStatement9 =

"SELECT REGISTEREDUSER.NAME, REGISTEREDUSER.EMAILADDRESS FROM DBO.REGISTEREDUSER INNER JOIN REGISTRATIONSTATUS ON REGISTEREDUSER.REGISTEREDUSERID = REGISTRATIONSTATUS.REGISTEREDUSERID INNER JOIN STATUSTYPE ON REGISTRATIONSTATUS.STATUSTYPEID = STATUSTYPE.STATUSTYPEID WHERE (REGISTRATIONSTATUS.CLASSID ='" + _classid + "' AND STATUSTYPE.STATUSCODE ='Waiting')"

 

 

 

SqlCommand.CommandText = SqlLookupStatement9

SqlCommand.Connection = SqlConnection

SqlCommand.Transaction = txn

 

' prepare data adapters/rows

 

 

 

 

Dim da_wait_user As New SqlDataAdapter(SqlCommand)

 

 

Dim ds_wait_user As New DataSet

 

 

Dim row_wait_user As DataRow

 

 

Dim _waitusername As String

 

 

 

 

Dim _waituserlist As New StringBuilder

 

da_wait_user.Fill(ds_wait_user)

 

For Each row_wait_user In ds_wait_user.Tables(0).Rows

 

_waitusername = row_wait_user(

"NAME")

 

 

' create wait list

 

 

 

_waituserlist.AppendLine(_waitusername)

 

Next

 

 

 

 

 

' reset sql statement

 

 

 

SqlStatement.Remove(0, SqlStatement.Length)

RecordsAffected = 0

SqlStatement.Append(

"DELETE FROM DBO.APPLICATIONLINKS WHERE CLASSID = '" + _classid + "'")

 

 

Dim deleteQuery = SqlStatement.ToString

 

SqlCommand.CommandText = deleteQuery

SqlCommand.Connection = SqlConnection

SqlCommand.Transaction = txn

RecordsAffected = SqlCommand.ExecuteNonQuery()

 

' reset sql statement

 

 

 

SqlStatement.Remove(0, SqlStatement.Length)

RecordsAffected = 0

SqlStatement.Append(

"DELETE FROM DBO.REMINDERS WHERE CLASSID = '" + _classid + "'")

 

deleteQuery = SqlStatement.ToString

SqlCommand.CommandText = deleteQuery

SqlCommand.Connection = SqlConnection

SqlCommand.Transaction = txn

RecordsAffected = SqlCommand.ExecuteNonQuery()

 

' reset sql statement

 

 

 

SqlStatement.Remove(0, SqlStatement.Length)

RecordsAffected = 0

SqlStatement.Append(

"DELETE FROM DBO.DISCLAIMER WHERE CLASSID = '" + _classid + "'")

 

deleteQuery = SqlStatement.ToString

SqlCommand.CommandText = deleteQuery

SqlCommand.Connection = SqlConnection

SqlCommand.Transaction = txn

RecordsAffected = SqlCommand.ExecuteNonQuery()

 

' reset sql statement

 

 

 

SqlStatement.Remove(0, SqlStatement.Length)

RecordsAffected = 0

SqlStatement.Append(

"DELETE FROM DBO.REGISTRATIONSTATUS WHERE CLASSID = '" + _classid + "'")

 

deleteQuery = SqlStatement.ToString

SqlCommand.CommandText = deleteQuery

SqlCommand.Connection = SqlConnection

SqlCommand.Transaction = txn

RecordsAffected = SqlCommand.ExecuteNonQuery()

 

' reset sql statement

 

 

 

SqlStatement.Remove(0, SqlStatement.Length)

RecordsAffected = 0

SqlStatement.Append(

"DELETE FROM DBO.CLASSSTATUS WHERE CLASSID = '" + _classid + "'")

 

deleteQuery = SqlStatement.ToString

SqlCommand.CommandText = deleteQuery

SqlCommand.Connection = SqlConnection

SqlCommand.Transaction = txn

RecordsAffected = SqlCommand.ExecuteNonQuery()

 

' reset sql statement

 

 

 

SqlStatement.Remove(0, SqlStatement.Length)

RecordsAffected = 0

SqlStatement.Append(

"DELETE FROM DBO.CLASSES WHERE CLASSID = '" + _classid + "'")

 

deleteQuery = SqlStatement.ToString

SqlCommand.CommandText = deleteQuery

SqlCommand.Connection = SqlConnection

SqlCommand.Transaction = txn

RecordsAffected = SqlCommand.ExecuteNonQuery()

 

' determine if the user has no other classes associated; then delete their profile

 

 

 

 

' reset sql statement

 

 

 

SqlStatement.Remove(0, SqlStatement.Length)

RecordsAffected = 0

SqlStatement.Append(

"DELETE FROM DBO.REGISTEREDUSER WHERE REGISTEREDUSERID NOT IN(SELECT REGISTEREDUSERID FROM DBO.REGISTRATIONSTATUS WHERE REGISTEREDUSERID = REGISTEREDUSER.REGISTEREDUSERID)")

 

deleteQuery = SqlStatement.ToString

SqlCommand.CommandText = deleteQuery

SqlCommand.Connection = SqlConnection

SqlCommand.Transaction = txn

RecordsAffected = SqlCommand.ExecuteNonQuery()

 

' commit transaction

 

 

 

txn.Commit()

 

SqlLookupStatement1 =

"SELECT AD_EMAILADDRESS FROM DBO.APPUSER"

 

 

 

SqlCommand.CommandText = SqlLookupStatement1

SqlCommand.Connection = SqlConnection

SqlCommand.Transaction = txn

 

' prepare data adapters/rows

 

 

 

 

Dim da_email_admin As New SqlDataAdapter(SqlCommand)

 

 

Dim ds_email_admin As New DataSet

 

 

Dim row_email_admin As DataRow

 

da_email_admin.Fill(ds_email_admin)

 

For Each row_email_admin In ds_email_admin.Tables(0).Rows

 

_emailaddress = row_email_admin(

"AD_EMAILADDRESS")

 

 

' send Administrative e-mail

 

 

 

SendAdminEmail(_emailaddress, _userlist, _waituserlist, _name, _date, _starttime, _endtime, _location, _description, _statuscode)

 

Next

 

 

 

 

 

Else ' class [Pending/Closed] being deleted -- no notifications needed

 

 

 

 

'lookup the CLASSES.DATE

 

 

 

 

Dim _date As String

 

 

 

SqlLookupStatement7 =

"SELECT DATE FROM DBO.CLASSES WHERE CLASSID = '" + _classid + "'"

 

 

 

SqlCommand.CommandText = SqlLookupStatement7

SqlCommand.Connection = SqlConnection

SqlCommand.Transaction = txn

_date = System.Convert.ToString(SqlCommand.ExecuteScalar)

 

'lookup the CLASSES.STARTIME

 

 

 

 

Dim _starttime As String

 

 

 

SqlLookupStatement4 =

"SELECT STARTTIME FROM DBO.CLASSES WHERE CLASSID = '" + _classid + "'"

 

 

 

SqlCommand.CommandText = SqlLookupStatement4

SqlCommand.Connection = SqlConnection

SqlCommand.Transaction = txn

_starttime = System.Convert.ToString(SqlCommand.ExecuteScalar)

 

'lookup the CLASSES.ENDTIME

 

 

 

 

Dim _endtime As String

 

 

 

SqlLookupStatement5 =

"SELECT ENDTIME FROM DBO.CLASSES WHERE CLASSID = '" + _classid + "'"

 

 

 

SqlCommand.CommandText = SqlLookupStatement5

SqlCommand.Connection = SqlConnection

SqlCommand.Transaction = txn

_endtime = System.Convert.ToString(SqlCommand.ExecuteScalar)

 

'lookup the CLASSES.LOCATION

 

 

 

 

Dim _location As String

 

 

 

SqlLookupStatement6 =

"SELECT LOCATION FROM DBO.CLASSES WHERE CLASSID = '" + _classid + "'"

 

 

 

SqlCommand.CommandText = SqlLookupStatement6

SqlCommand.Connection = SqlConnection

SqlCommand.Transaction = txn

_location = System.Convert.ToString(SqlCommand.ExecuteScalar)

 

'lookup the CLASSES.DESCRIPTION

 

 

 

 

Dim _description As String

 

 

 

SqlLookupStatement8 =

"SELECT DESCRIPTION FROM DBO.CLASSES WHERE CLASSID = '" + _classid + "'"

 

 

 

SqlCommand.CommandText = SqlLookupStatement8

SqlCommand.Connection = SqlConnection

SqlCommand.Transaction = txn

_description = System.Convert.ToString(SqlCommand.ExecuteScalar)

 

 

' reset sql statement

 

 

 

SqlStatement.Remove(0, SqlStatement.Length)

RecordsAffected = 0

 

' user list

 

 

 

SqlLookupStatement3 =

"SELECT REGISTEREDUSER.NAME, REGISTEREDUSER.EMAILADDRESS FROM DBO.REGISTEREDUSER INNER JOIN REGISTRATIONSTATUS ON REGISTEREDUSER.REGISTEREDUSERID = REGISTRATIONSTATUS.REGISTEREDUSERID INNER JOIN STATUSTYPE ON REGISTRATIONSTATUS.STATUSTYPEID = STATUSTYPE.STATUSTYPEID WHERE (REGISTRATIONSTATUS.CLASSID ='" + _classid + "' AND STATUSTYPE.STATUSCODE ='Enrolled')"

 

 

 

SqlCommand.CommandText = SqlLookupStatement3

SqlCommand.Connection = SqlConnection

SqlCommand.Transaction = txn

 

' prepare data adapters/rows

 

 

 

 

Dim da_email_user As New SqlDataAdapter(SqlCommand)

 

 

Dim ds_email_user As New DataSet

 

 

Dim row_email_user As DataRow

 

 

Dim _emailaddress As String

 

 

 

 

Dim _username As String

 

 

 

 

Dim _userlist As New StringBuilder

 

da_email_user.Fill(ds_email_user)

 

For Each row_email_user In ds_email_user.Tables(0).Rows

 

_username = row_email_user(

"NAME")

 

 

' create affected user list

 

 

 

_userlist.AppendLine(_username)

 

Next

 

 

 

 

' reset sql statement

 

 

 

SqlStatement.Remove(0, SqlStatement.Length)

RecordsAffected = 0

 

 

' wait list

 

 

 

SqlLookupStatement9 =

"SELECT REGISTEREDUSER.NAME, REGISTEREDUSER.EMAILADDRESS FROM DBO.REGISTEREDUSER INNER JOIN REGISTRATIONSTATUS ON REGISTEREDUSER.REGISTEREDUSERID = REGISTRATIONSTATUS.REGISTEREDUSERID INNER JOIN STATUSTYPE ON REGISTRATIONSTATUS.STATUSTYPEID = STATUSTYPE.STATUSTYPEID WHERE (REGISTRATIONSTATUS.CLASSID ='" + _classid + "' AND STATUSTYPE.STATUSCODE ='Waiting')"

 

 

 

SqlCommand.CommandText = SqlLookupStatement9

SqlCommand.Connection = SqlConnection

SqlCommand.Transaction = txn

 

' prepare data adapters/rows

 

 

 

 

Dim da_wait_user As New SqlDataAdapter(SqlCommand)

 

 

Dim ds_wait_user As New DataSet

 

 

Dim row_wait_user As DataRow

 

 

Dim _waitusername As String

 

 

 

 

Dim _waituserlist As New StringBuilder

 

da_wait_user.Fill(ds_wait_user)

 

For Each row_wait_user In ds_wait_user.Tables(0).Rows

 

_waitusername = row_wait_user(

"NAME")

 

 

' create wait list

 

 

 

_waituserlist.AppendLine(_waitusername)

 

Next

 

 

 

 

SqlLookupStatement1 =

"SELECT AD_EMAILADDRESS FROM DBO.APPUSER"

 

 

 

SqlCommand.CommandText = SqlLookupStatement1

SqlCommand.Connection = SqlConnection

SqlCommand.Transaction = txn

 

' prepare data adapters/rows

 

 

 

 

Dim da_email_admin As New SqlDataAdapter(SqlCommand)

 

 

Dim ds_email_admin As New DataSet

 

 

Dim row_email_admin As DataRow

 

da_email_admin.Fill(ds_email_admin)

 

For Each row_email_admin In ds_email_admin.Tables(0).Rows

 

_emailaddress = row_email_admin(

"AD_EMAILADDRESS")

 

 

' send Administrative e-mail

 

 

 

SendAdminEmail(_emailaddress, _userlist, _waituserlist, _name, _date, _starttime, _endtime, _location, _description, _statuscode)

 

Next

 

 

 

 

 

' reset sql statement

 

 

 

SqlStatement.Remove(0, SqlStatement.Length)

RecordsAffected = 0

 

 

SqlStatement.Append(

"DELETE FROM DBO.APPLICATIONLINKS WHERE CLASSID = '" + _classid + "'")

 

 

Dim deleteQuery = SqlStatement.ToString

 

SqlCommand.CommandText = deleteQuery

SqlCommand.Connection = SqlConnection

SqlCommand.Transaction = txn

RecordsAffected = SqlCommand.ExecuteNonQuery()

 

' reset sql statement

 

 

 

SqlStatement.Remove(0, SqlStatement.Length)

RecordsAffected = 0

SqlStatement.Append(

"DELETE FROM DBO.REMINDERS WHERE CLASSID = '" + _classid + "'")

 

deleteQuery = SqlStatement.ToString

SqlCommand.CommandText = deleteQuery

SqlCommand.Connection = SqlConnection

SqlCommand.Transaction = txn

RecordsAffected = SqlCommand.ExecuteNonQuery()

 

' reset sql statement

 

 

 

SqlStatement.Remove(0, SqlStatement.Length)

RecordsAffected = 0

SqlStatement.Append(

"DELETE FROM DBO.DISCLAIMER WHERE CLASSID = '" + _classid + "'")

 

deleteQuery = SqlStatement.ToString

SqlCommand.CommandText = deleteQuery

SqlCommand.Connection = SqlConnection

SqlCommand.Transaction = txn

RecordsAffected = SqlCommand.ExecuteNonQuery()

 

' reset sql statement

 

 

 

SqlStatement.Remove(0, SqlStatement.Length)

RecordsAffected = 0

SqlStatement.Append(

"DELETE FROM DBO.REGISTRATIONSTATUS WHERE CLASSID = '" + _classid + "'")

 

deleteQuery = SqlStatement.ToString

SqlCommand.CommandText = deleteQuery

SqlCommand.Connection = SqlConnection

SqlCommand.Transaction = txn

RecordsAffected = SqlCommand.ExecuteNonQuery()

 

' reset sql statement

 

 

 

SqlStatement.Remove(0, SqlStatement.Length)

RecordsAffected = 0

SqlStatement.Append(

"DELETE FROM DBO.CLASSSTATUS WHERE CLASSID = '" + _classid + "'")

 

deleteQuery = SqlStatement.ToString

SqlCommand.CommandText = deleteQuery

SqlCommand.Connection = SqlConnection

SqlCommand.Transaction = txn

RecordsAffected = SqlCommand.ExecuteNonQuery()

 

' reset sql statement

 

 

 

SqlStatement.Remove(0, SqlStatement.Length)

RecordsAffected = 0

SqlStatement.Append(

"DELETE FROM DBO.CLASSES WHERE CLASSID = '" + _classid + "'")

 

deleteQuery = SqlStatement.ToString

SqlCommand.CommandText = deleteQuery

SqlCommand.Connection = SqlConnection

SqlCommand.Transaction = txn

RecordsAffected = SqlCommand.ExecuteNonQuery()

 

' determine if the user has no other classes associated; then delete their profile

 

 

 

 

' reset sql statement

 

 

 

SqlStatement.Remove(0, SqlStatement.Length)

RecordsAffected = 0

SqlStatement.Append(

"DELETE FROM DBO.REGISTEREDUSER WHERE REGISTEREDUSERID NOT IN(SELECT REGISTEREDUSERID FROM DBO.REGISTRATIONSTATUS WHERE REGISTEREDUSERID = REGISTEREDUSER.REGISTEREDUSERID)")

 

deleteQuery = SqlStatement.ToString

SqlCommand.CommandText = deleteQuery

SqlCommand.Connection = SqlConnection

SqlCommand.Transaction = txn

RecordsAffected = SqlCommand.ExecuteNonQuery()

 

' commit transaction

 

 

 

txn.Commit()

 

End If

 

 

 

 

 

Catch ex As Exception

 

 

' rollback transaction

 

 

 

txn.Rollback()

RadGrid1.Controls.Add(

New LiteralControl("Unable to Delete. Reason: " + ex.Message))

 

e.Canceled =

True

 

 

 

 

 

End Try

 

 

 

 

End Using

 

 

 

 

' end transaction

 

 

 

 

 

' close the SqlConnection

 

 

 

SqlConnection.Close()

 

End If

 

 

 

 

 

End Sub

 

Princy
Top achievements
Rank 2
 answered on 26 Feb 2009
3 answers
131 views
Hi all,

I am wanting to strip our implementation down to only one font: Arial. I have modified the ListToolsFile.xml to have the following:
<fontNames>
 <fontName name="Arial"/>
</fontNames>

However the default font is still Times New Roman. When I start typing the font is stuck in Times New Roman until I manually change it to the only available font which is Arial.

Can anyone please advise on how to stop the editor defaulting to Times New Roman.

Many thanks

Justin
Stanimir
Telerik team
 answered on 26 Feb 2009
1 answer
289 views
Hello guys

i need to find the raddatepicker control in client side for compare two dates.

i tried next code with no results.

                              var panelbar = $find("<%= RadPanelBar1.ClientID %>");
                               var item = panelbar.findItemByText("Reports");
                               var datePicker = item.findControl("rdpStartDate");

this is the source code.

<telerik:RadSplitter ID="MainSplitter" runat="server" Height="100%" Width="100%" Orientation="Horizontal" Skin="Outlook">  
    <telerik:RadPane ID="TopPane" runat="server" Height="1" MinHeight="1" MaxHeight="1"  Scrolling="none">                              
     </telerik:RadPane>  

    <telerik:RadSplitBar ID="RadsplitbarTop" runat="server" CollapseMode="Forward" />  

    <telerik:RadPane ID="MainPane" runat="server" Scrolling="none" MinWidth="500"><telerik:RadSplitter ID="NestedSplitter" runat="server" Skin="Outlook" LiveResize="true"><telerik:RadPane ID="LeftPane" runat="server" Width="220" MinWidth="220" MaxWidth="220">
    <telerik:RadPanelBar runat="server" ID="RadPanelBar1" Skin="Office2007" ExpandMode="FullExpandedItem">
            <CollapseAnimation Duration="100" Type="None" />
            <Items>
            <telerik:RadPanelItem Value="Reports"  Text="Reports" ImageUrl="Img/tasks.gif" Expanded="True">
                    <ItemTemplate>
                                     
                    <telerik:RadDatePicker ID="rdpStartDate" runat="server" Skin="Office2007"
                        Width="85">
                        <DateInput
                             DateFormat="dd/MM/yy"
                             DisplayDateFormat="dd/MMM/yyyy"
                             EmptyMessage ="dd/mm/aa"
                             >
                        </DateInput>
                        <DatePopupButton TabIndex="-1" />
                    </telerik:RadDatePicker>
                    
                    </ItemTemplate>
            </telerik:RadPanelItem>
            
            </Items>
            <ExpandAnimation Duration="100" Type="None" />
            </telerik:RadPanelBar>
            </telerik:RadPane><telerik:RadSplitBar ID="VerticalSplitBar" runat="server" CollapseMode="Forward" />
            <telerik:RadPane ID="ContentPane" runat="server">
            </telerik:RadPane></telerik:RadSplitter>
            </telerik:RadPane>  
</telerik:RadSplitter> 


thanks in advanced.
Daniel
Telerik team
 answered on 26 Feb 2009
1 answer
83 views
Hi

This window control is very slick and easy to use. Nice job!

I have just a small problem:
I have set Behaviors to Close,Move but there remains a small icon like a clipboard
in the top left corner of the window.

What is this?

How to remove it if it does nothing in my application?

Thanks

Clive
Georgi Tunev
Telerik team
 answered on 26 Feb 2009
4 answers
130 views
Hi,

I am wondering if there was a way to sync the appointments, etc, with a mobile device?  Pocket outlook 2007?  I am storing appointments, etc, in a database, and don't have access to an exchange server?  I guess, I want to somehow "mimic" an exchange server....  Anyone have any pointers?

Thanks,


Richard
Albert
Top achievements
Rank 1
 answered on 26 Feb 2009
1 answer
164 views
Is there a recommendation for the maximum page size in the Grid? Perhaps some point when performance gets sluggish or the browser starts to choke? It will be running on modern computers (<2 years old). Thanks.
Princy
Top achievements
Rank 2
 answered on 26 Feb 2009
1 answer
364 views
Hi

I have battled with this before and never managed to implement this correctly.
I have a datagrid (telerik rad grid) which I'm binding to say 10,000 records which is either a datatable or collection / list of items.

Now the problem is that the grid only shows 10 records (it is paged) but everytime the user navigates to the page with the grid on it has to retrieve all 10,000 records from the database, and also when the user navigates to say page 2 on the grid to see the next 10 records the application has to again retrieve all 10,000 records from the database and then bind it to the grid to show only the required 10 records.

How can I cleverly get away from this way of doing things by only returning the required records? and also bear in mind that the data in the database may change? I'm stumped no finding a solution for this one? maybe I'm just not seeing the simple solution?

Please advise if possible.
Shinu
Top achievements
Rank 2
 answered on 26 Feb 2009
6 answers
111 views
Hi Friends,
     I am using custom skins in my projects, where every thing works fine except the images are not
     displayed in the radeditor for both FireFox and IE7.

can anyone help me.

thanks
K²
kiran
Top achievements
Rank 1
 answered on 26 Feb 2009
Narrow your results
Selected tags
Tags
+? more
Top users last month
Shiori
Top achievements
Rank 2
Iron
Tien
Top achievements
Rank 1
Iron
Robert
Top achievements
Rank 1
Rob
Top achievements
Rank 4
Bronze
Bronze
Iron
Geoff
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Top users last month
Shiori
Top achievements
Rank 2
Iron
Tien
Top achievements
Rank 1
Iron
Robert
Top achievements
Rank 1
Rob
Top achievements
Rank 4
Bronze
Bronze
Iron
Geoff
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?