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

I need the a Modal RAD Window to resize when the parent window gets resized.

The width and height of the RAD Window is 80% of the parent window width and height.

I suspect that i have to attach a onresize event in the parent window and then calculate the new width and height using JavaScript. Is there an easier way to accomplish this? 

... also is there any sample code available on how to resize a window from the parent window.

Kind regards

Tony
Georgi Tunev
Telerik team
 answered on 20 Oct 2008
1 answer
139 views
Hi All,

I am using RadScheduler

How can set the default cursor pointer to 'Hand' when mouse move over the appointment.

Thanks
Dimo
Telerik team
 answered on 20 Oct 2008
1 answer
126 views
I just downloaded the latest Oct. Service Pack and I have noticed that RadWindow cannot be closed after the first time. First time open close is not a problem but when I open the window the second time and I can't do anything it's like there is another modal popup on top of it and screen is gray and Radwindow is underneath that. I am opening the Window using oWnd.maximize() command when I open it (if that makes any difference). The previous version was working just fine.

Thanks
Himadri
Georgi Tunev
Telerik team
 answered on 20 Oct 2008
1 answer
166 views
Can u pls advise me how to display the rad alert window on certain condition (VB-codebehind)

For EX:

If

 

LstCPVStatus.SelectedValue = 0 Then
MsgBox1.alert("Select CPV Status") // this is some third pary control
Exit Sub
End If

Similaryly i need to use the radalert on this condition.How can i display with the above alert  msg ..

thanks & regards

 

Georgi Tunev
Telerik team
 answered on 20 Oct 2008
1 answer
86 views
My application loads ascx controls in a RadAjaxPanel. I can't use javascript inside the panel.

I am not a experienced in using Ajax. I think this is because the html-code is not rendered? For example. The ascx contains a RadGrid. I can't find the RadGrid control using javascript : var grid = window[radGridId]; or document.getElementById(radGridId);.

How do i detect controls loaded dynamically with AJAX?
Dimo
Telerik team
 answered on 20 Oct 2008
0 answers
114 views
Hi,

i am using treeview. To bind the treeview i am using Load on demand concept.

while binding,

node.ExpandMode = TreeNodeExpandMode.ServerSide;  in this line i am getting the following error,

The name 'TreeNodeExpandMode' does not exist in the current context

how can i solve this, pls help me.
cv
Top achievements
Rank 1
 asked on 20 Oct 2008
1 answer
151 views
I have a form that uses the Vista skin, but there is one particular button I want to use a custom FormDecorator skin with.

This particular button will look differently than all the rest. Is there an easy way to apply the custom form decorator skin to the button manually? Or any other suggestions? I do not think custom decoration zones will work here.
Martin
Telerik team
 answered on 20 Oct 2008
1 answer
166 views
We are used RadGrid with MasterTabelView and DetailTableView to display hirachycal data.We implemented needdatasource to bind grid and pageindexchage to handle pagechage event but We have problem when DetailTableView need to change pageindex.How we do to handle me thode for DetailTableView pageindex change inside the MasterTableView.



Please Help
Princy
Top achievements
Rank 2
 answered on 20 Oct 2008
1 answer
117 views
Hi,
I want to changethe positionof legend of thetelerik rad chart .even if iset it to top, it still shows up on top-left .Please help.
   Thanks
Sudheep
Top achievements
Rank 1
 answered on 20 Oct 2008
1 answer
155 views

Hi,
    I have no problem when the grid has items in it.But the problem rises when I delete all the items in the grid where I am getting the empty grid layout.
The page is blank without any grid layout..
Please help

<telerik:RadGrid ID="RadGrid1" CssClass="RadGrid" EnableTheming="False" EnableEmbeddedBaseStylesheet="False" AllowMultiRowSelection="true" AllowMultiRowEdit="true"
            Skin="WebBlue" runat="server" AllowAutomaticDeletes="True" AllowAutomaticInserts="True"
            Width="97%" PageSize="14" AllowAutomaticUpdates="True" AllowPaging="True" AutoGenerateColumns="False"
           ShowStatusBar="true" >

                            <ItemStyle CssClass="RadGridItem"></ItemStyle>
                            <HeaderStyle CssClass="RadGridHeader"></HeaderStyle>
                            <PagerStyle Mode="Slider" alwaysvisible="True"  CssClass="RadGridPager" HorizontalAlign="Left" ></PagerStyle>
                            <ClientSettings >
                            <Selecting AllowRowSelect="true" />
                            </ClientSettings>
                      <MasterTableView CommandItemDisplay="Top" AutoGenerateColumns="False" NoMasterRecordsText="No Records found to display" Width="100%" EditMode="EditForms" >
                            <CommandItemTemplate>
                                <div style="padding:10px 0px;" class="newtd">
                                 <table cellpadding ="0" cellspacing ="0" border ="0" width ="100%">
                                    <tr>
                                        <td style="padding-left:5px">  &nbsp;Filter : &nbsp;</td>
                                        <td> <asp:TextBox  autocomplete="off"  ID="txtSearch" runat="server" OnTextChanged="txtSearch_TextChanged"></asp:TextBox>&nbsp;</td>
                                        <td style="padding-left:40px"><telerik:RadCombobox ID="rcbFieldName" runat="server"  AllowCustomText="True" width="140px" EmptyMessage="-------Select-------" CausesValidation="false">
                                        <Items>
                                        <telerik:RadComboBoxItem Text="Email" Value="Email" />
                                        </Items>
                                        </telerik:RadCombobox>&nbsp;&nbsp;</td>
                                        <td align ="left" style="padding-right:40px">
                                        <asp:ImageButton ID="btnSearch" runat="server" CommandName="btnSearch" ImageUrl="~/Images/icons/Zoom.gif" ImageAlign="Bottom"  CausesValidation="false"/>
                                        </td>
                                    <td align="right" style="padding:10px;" valign="middle">
                                    <asp:LinkButton Style="vertical-align: bottom" ID="btnEditSelected" runat="server"
                                    CommandName="EditSelected" CausesValidation="false" OnClientClick="return FnEdit()" Visible='<%# RadGrid1.EditIndexes.Count = 0 %>' ><img style="border:0px;vertical-align:middle;" alt="" src="../Images/icons/Edit.gif" /> Edit Selected PowerAdmin</asp:LinkButton>
                                    <asp:LinkButton ID="btnUpdateEdited" runat="server" CommandName="UpdateEdited" Visible='<%# RadGrid1.EditIndexes.Count > 0 %>'><img style="border:0px;vertical-align:middle;" alt="" src="../Images/icons/Save.gif" /> Update PowerAdmin</asp:LinkButton>
                                    &nbsp;
                                    <asp:LinkButton ID="btnInsert" runat="server" CommandName="InitInsert" Visible='<%# Not RadGrid1.MasterTableView.IsItemInserted %>'><img style="border:0px;vertical-align:middle;" alt="" src="../Images/icons/Add.gif" /> Add new PowerAdmin</asp:LinkButton>&nbsp;
                                    <asp:LinkButton ID="btnCancel" runat="server" CommandName="CancelAll" CausesValidation="false" Visible='<%# RadGrid1.EditIndexes.Count > 0 Or RadGrid1.MasterTableView.IsItemInserted %>'><img style="border:0px;vertical-align:middle;" alt="" src="../Images/icons/Cancel.gif" /> Cancel</asp:LinkButton>
                                    &nbsp;&nbsp;
                                    <asp:LinkButton ID="LinkButton1"
                                    runat="server" CommandName="DeleteSelected" CausesValidation="false" OnClientClick="return FnDelete()" ><img style="border:0px;vertical-align:middle;" alt="" src="../Images/icons/Delet.gif" /> Delete Selected PowerAdmin</asp:LinkButton>
                                    &nbsp;&nbsp;&nbsp;
                                    <asp:LinkButton ID="LinkButton4" runat="server" CommandName="RebindGrid"><img style="border:0px;vertical-align:middle;" alt="" src="../Images/icons/Refresh.gif" /> Refresh </asp:LinkButton>
                                   </td>
                                   </tr>
                                   </table>
                                </div>
                            </CommandItemTemplate>
                            <Columns>
                                <telerik:GridTemplateColumn UniqueName="SrlNo" AllowFiltering="False"  ItemStyle-HorizontalAlign="Left" ItemStyle-Width="2%" >
                                <ItemTemplate  >
                                    <asp:Label ID="lblSrlNo"  runat="server"  />&nbsp;&nbsp;
                                </ItemTemplate>                              
                                </telerik:GridTemplateColumn>
                                 <telerik:GridClientSelectColumn HeaderStyle-Width="3%" />
                                <telerik:GridBoundColumn DataField="SUserID" UniqueName="SUserID"  Visible="False"   ReadOnly="True"></telerik:GridBoundColumn>

                                <telerik:GridBoundColumn  DataField="Email" UniqueName="Email" SortExpression="Email" HeaderText="Email" ShowSortIcon="False"  >
                                    <ItemStyle HorizontalAlign="Left" />
                                </telerik:GridBoundColumn>
                                <telerik:GridBoundColumn DataField="Password" UniqueName="Password" HeaderText="Password" ShowSortIcon="false" >
                                <ItemStyle HorizontalAlign="Left" />
                                </telerik:GridBoundColumn>
                                <telerik:GridCheckBoxColumn DataField="UserStatus" HeaderText="Status" SortExpression="Discontinued" UniqueName="Discontinued" EditFormColumnIndex="1">
                                  <ItemStyle HorizontalAlign="Left" />
                                </telerik:GridCheckBoxColumn>
                             
                            </Columns>

        
          
                                  <EditFormSettings  EditFormType="Template"  >
                                            <FormTableItemStyle Wrap="False"></FormTableItemStyle>
                                            <FormCaptionStyle CssClass="RadGridHeader"></FormCaptionStyle>
                                            <FormMainTableStyle BackColor="White" GridLines="Horizontal" CellPadding="3" Width="100%" CellSpacing="0"></FormMainTableStyle>
                                            <FormTableStyle CellSpacing="0" CellPadding="2" CssClass="module" Height="110px" BackColor="White" />
                                            <FormTableAlternatingItemStyle Wrap="False"></FormTableAlternatingItemStyle>
                                           <EditColumn CancelText="Cancel edit" InsertText="Insert Order"  UniqueName="EditCommandColumn1" ButtonType="ImageButton" UpdateText="Update record">
                                           </EditColumn>
                                            <FormTableButtonRowStyle HorizontalAlign="Right" CssClass="EditFormButtonRow"></FormTableButtonRowStyle>
                                             <FormTemplate >
                                                     <table cellpadding="0"  cellspacing="0" width="100%" border="0">
                                                        <tr><td style="height:3px;" colspan ="2"></td></tr>
                                                            <tr><td align="right" colspan="2">
                                                                <asp:ImageButton ID="btnUpdate" Text='<%# IIf((TypeOf(Container) is GridEditFormInsertItem), "Insert", "Update") %>' ImageUrl="~/Images/icons/Update.gif"
                                                                    runat="server" CommandName='<%# IIf((TypeOf(Container) is GridEditFormInsertItem), "PerformInsert", "Update")%>'>
                                                                </asp:ImageButton>&nbsp;
                                                                <asp:ImageButton ID="Button1" Text="Cancel" runat="server" CausesValidation="False" ImageUrl="~/Images/icons/CancelEdit.gif"
                                                                CommandName="Cancel"></asp:ImageButton></td>
                                                           </tr>
                                                          <tr>
                                                          <td colspan="2">
                                                           <asp:HiddenField ID="hidSuserId" runat="server" Visible="False" value='<%#Bind("SUserID") %>' />
                                                          </td>
                                                          </tr>
                                                        <tr >
                                                            <td align="right" width="40%" >Email&nbsp;<font color="red" >*</font>:&nbsp;</td>
                                                            <td align="left" width="60%" ><asp:TextBox ID="txtemail" runat="server" Text='<%#Bind("Email") %>'   ></asp:TextBox>
                                                                <asp:RequiredFieldValidator ID="ReqEmail" runat="server" ControlToValidate="txtEmail"
                                                                    Display="Dynamic" CssClass="errormsg" ErrorMessage="Enter Email"></asp:RequiredFieldValidator><asp:RegularExpressionValidator ID="RegEmail" runat="server" ControlToValidate="txtEmail"
                                                                    Display="Dynamic" CssClass="errormsg" ErrorMessage="Invalid Email" ValidationExpression="\w+([-+.']\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*"></asp:RegularExpressionValidator></td>
                                                        </tr>
                                                          <tr><td colspan="2" align="center" >
                                                                <div id="DivPasswordReadOnly"  runat="server">
                                                                    <table cellpadding="0"  cellspacing="0" border="0" width="100%">
                                                                        <tr><td style="height:5px"></td></tr>
                                                                        <tr><td align="right"  width="40%">Password&nbsp;<font color="red" >*</font>:&nbsp;</td>
                                                                            <td align="left" width="60%" ><asp:TextBox ID="txtpopPassword" runat="server" Text="**********" onclick='<%# "openPrompt(this, event, " & Eval("SUserId", "{0:#}") & ")"%>' readonly="true"></asp:TextBox></td></tr>
                                                                         <tr><td style="height:5px"></td></tr>
                                                                         <tr><td align="right"  width="40%">User Status &nbsp;<font color="red" >*</font>:&nbsp;</td>
                                                                             <td align="left" width="60%" >
                                                                                 <asp:RadioButton GroupName="grpuserstatus" runat="server" ID="checkDisable" text="Disable" Checked='<%# IIf(Val(""& Eval("UserStatus"))= 0,"False","True") %>'/>
                                                                                  <asp:RadioButton  GroupName="grpuserstatus" runat="server" ID="checkEnable" text="Enable" Checked='<%# IIf(Val(""& Eval("UserStatus"))= 0,"True","False") %>'/>
                                                                             </td></tr>
                                                                             <tr><td style="height:5px"></td></tr>
                                                                    </table>
                                                                </div>
                                                                <div id="DivPassword"  runat="server" visible="false">
                                                                    <table cellpadding="0"  cellspacing="0" border="0" width="100%">
                                                                        <tr><td style="height:5px"></td></tr>
                                                                        <tr><td align="right"  width="40%">Password&nbsp;<font color="red" >*</font>:&nbsp;</td>
                                                                            <td align="left" width="60%" ><asp:TextBox  ID="txtPassword" TextMode="Password" runat="server" MaxLength="10" ></asp:TextBox><asp:RequiredFieldValidator 
                                                                                ID="reqPassword" runat="server" CssClass="errormsg" ControlToValidate="txtPassword" Display="Dynamic" ErrorMessage="Enter Password"></asp:RequiredFieldValidator><asp:RegularExpressionValidator 
                                                                                ID="regPassword"  runat="server" ControlToValidate="txtPassword" CssClass="errormsg" Display="Dynamic" ErrorMessage="Invalid Password" ValidationExpression="\w{6,10}"></asp:RegularExpressionValidator></td></tr>
                                                                        <tr><td style="height:5px"></td></tr>
                                                                        <tr><td align="right"  width="40%">Retype Password&nbsp;<font color="red" >*</font>:&nbsp;</td>
                                                                            <td align="left" width="60%" ><asp:TextBox ID="txtRePassword" TextMode="Password" runat="server" MaxLength="10" ></asp:TextBox><asp:RequiredFieldValidator 
                                                                                ID="reqRePassword" runat="server" ControlToValidate="txtRePassword" CssClass="errormsg" Display="Dynamic" ErrorMessage="Enter Re-Type Password"></asp:RequiredFieldValidator><asp:RegularExpressionValidator 
                                                                                ID="regRePassword"  runat="server" ControlToValidate="txtRePassword" CssClass="errormsg" Display="Dynamic" ErrorMessage="Invalid Re-Type Password" ValidationExpression="\w{6,10}"></asp:RegularExpressionValidator><asp:CompareValidator
                                                                                ID="cmpPassword" runat="server" ControlToCompare="txtPassword" ControlToValidate="txtRePassword" CssClass="errormsg" Display="Dynamic" ErrorMessage="Password Mismatch"  ></asp:CompareValidator></td></tr>
                                                                        <tr><td style="height:5px"></td></tr>
                                                                     </table>
                                                                  </div>
                                                                  <div id="checkstatus" runat="server" >
                                                                 
                                                                    </div>
                                                            </td></tr>
                                                            <tr><td  align="center"><asp:Label runat="server" ID="lblMsg" Text=""  ForeColor="red"></asp:Label></td></tr>

                                                        </table>
                                 
                                            </FormTemplate>
                                  </EditFormSettings>

                                    <ExpandCollapseColumn>
                                    <HeaderStyle Width="20px"></HeaderStyle>
                                    </ExpandCollapseColumn>

                                    <RowIndicatorColumn>
                                    <HeaderStyle Width="20px"></HeaderStyle>
                                    </RowIndicatorColumn>
                       </MasterTableView>

                                <FilterMenu EnableTheming="True" Skin="WebBlue" enableembeddedbasestylesheet="False">
                                <CollapseAnimation Type="OutQuint" Duration="200"></CollapseAnimation>
                                </FilterMenu>

                                <AlternatingItemStyle CssClass="RadGridItem"></AlternatingItemStyle>

                    <SortingSettings  SortToolTip="Click here to sort Email"></SortingSettings>
                 </telerik:RadGrid>


and my server side code is


 

Imports

Telerik.Web.UI

 

 

 

Partial

Class Clients_ManagePAdmin

 

 

Inherits System.Web.UI.Page

 

 

Dim oDB As New CMSDatabase

 

 

Dim SqlQry As String = ""

 

 

 

 

Protected Sub Page_PreInit(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.PreInit

 

 

Dim UserTheme As MyThemes = Val(Session("@Theme"))

 

 

Me.Theme = UserTheme.ToString

 

 

Dim RadSkin As String = Replace(UserTheme.ToString, "_", "")

 

RadGrid1.Skin = RadSkin

 

' rcbFieldName.Skin = RadSkin

 

 

 

 

End Sub

 

 

 

 

Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load

 

Ajax.Utility.RegisterTypeForAjax(

Me.GetType)

 

SqlQry =

"select SUserId,Email,Password, case UserStatus when 0 then 'true' else 'false' end as UserStatus from siteusers where usertype= " & UserType.PowerAdmin

 

 

If Not oDB.IsExist(SqlQry) Then

 

 

 

Response.Redirect(

"PowerAdmin.aspx")

 

 

End If

 

 

 

 

End Sub

 

 

 

<Ajax.JavascriptMethod()> _

 

Function updaterecords(ByVal Passs, ByVal SUserId) As Boolean

 

 

 

 

Dim SqlQry As String = "UPDATE siteusers set password='" & NDCryption.Encrypt(Passs) & "' where SUserId = " & SUserId & ""

 

 

 

 

Return oDB.ExecuteNonQuery(SqlQry)

 

 

End Function

 

 

 

 

Protected Sub RadGrid1_NeedDataSource(ByVal source As Object, ByVal e As Telerik.Web.UI.GridNeedDataSourceEventArgs) Handles RadGrid1.NeedDataSource

 

 

Dim sqlqry As String

 

 

 

 

Dim DT As New DataTable

 

 

'sqlqry = "select SUserId,Email,Password,UserStatus from siteusers where usertype= " & UserType.PowerAdmin

 

 

 

sqlqry =

"select SUserId,Email,Password, case UserStatus when 0 then 'true' else 'false' end as UserStatus from siteusers where usertype= " & UserType.PowerAdmin

 

 

If oDB.IsExist(sqlqry) = True Then

 

 

 

DT = oDB.GetDataTable(sqlqry)

RadGrid1.Visible =

True

 

 

 

RadGrid1.DataSource = DT

 

End If

 

 

 

 

End Sub

 

 

 

 

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

 

 

If e.Item.ItemType = GridItemType.AlternatingItem Or e.Item.ItemType = Telerik.Web.UI.GridItemType.Item Then

 

 

 

 

Dim lbl As Label

 

lbl =

CType(e.Item.FindControl("lblSrlNo"), Label)

 

lbl.Text = e.Item.ItemIndex + 1

 

 

Try

 

 

 

 

Dim item As GridDataItem

 

item = e.Item

item(

"Password").Text = NDCryption.Decrypt(item("Password").Text)

 

 

If Trim(item("Password").Text) <> "" Then

 

 

 

item(

"Password").Text = "".PadLeft(Len(item("Password").Text), "*")

 

 

End If

 

 

 

 

 

Catch ex As Exception

 

 

End Try

 

 

 

 

End If

 

 

 

 

If TypeOf e.Item Is GridEditFormItem AndAlso e.Item.IsInEditMode Then

 

 

 

 

 

 

End If

 

 

 

 

End Sub

 

 

 

 

Private Sub RadGrid1_SortCommand(ByVal source As Object, ByVal e As Telerik.Web.UI.GridSortCommandEventArgs) Handles RadGrid1.SortCommand

 

 

If e.Item.OwnerTableView.DataMember = "Orders" And e.SortExpression = "Email" Then

 

 

 

e.Canceled =

True

 

 

 

 

Dim expression As New GridSortExpression()

 

expression.FieldName =

"Email"

 

 

 

 

If e.Item.OwnerTableView.SortExpressions.Count = 0 OrElse e.Item.OwnerTableView.SortExpressions(0).FieldName <> e.SortExpression Then

 

 

 

expression.SortOrder = GridSortOrder.Descending

 

ElseIf e.Item.OwnerTableView.SortExpressions(0).SortOrder = GridSortOrder.Descending Then

 

 

 

expression.SortOrder = GridSortOrder.Ascending

 

ElseIf e.Item.OwnerTableView.SortExpressions(0).SortOrder = GridSortOrder.Ascending Then

 

 

 

expression.SortOrder = GridSortOrder.None

 

End If

 

 

 

e.Item.OwnerTableView.SortExpressions.AddSortExpression(expression)

e.Item.OwnerTableView.Rebind()

 

End If

 

 

 

 

End Sub 'RadGrid1_SortCommand

 

 

 

 

Protected Sub txtSearch_TextChanged(ByVal sender As Object, ByVal e As EventArgs)

 

 

Dim txt As TextBox = TryCast(DirectCast(sender, TextBox), TextBox)

 

 

Dim list As RadComboBox = DirectCast(((txt.NamingContainer).FindControl("rcbFieldName")), RadComboBox)

 

 

Dim [option] As String

 

 

 

 

If list.SelectedValue = "SUserId" OrElse list.SelectedValue = "UserStatus" Then

 

 

 

[option] =

" = "

 

 

 

 

Else

 

 

 

[option] =

" LIKE "

 

 

 

 

End If

 

 

 

 

Dim filterExpression As String

 

 

 

 

If [option] = " = " Then

 

 

 

filterExpression =

"(" + list.SelectedValue + [option] + txt.Text + ")"

 

 

 

 

Else

 

 

 

filterExpression =

"(" + list.SelectedValue + [option] + "'" + txt.Text + "%'" + ")"

 

 

 

 

End If

 

 

 

RadGrid1.MasterTableView.FilterExpression = filterExpression

RadGrid1.MasterTableView.Rebind()

 

End Sub

 

 

 

 

Protected Sub RadGrid1_UpdateCommand(ByVal source As Object, ByVal e As Telerik.Web.UI.GridCommandEventArgs) Handles RadGrid1.UpdateCommand

 

e.Canceled =

True

 

 

 

 

Dim item As GridEditableItem = TryCast(e.Item, GridEditableItem)

 

 

'Dim txtsid As TextBox

 

 

 

 

'txtsid = CType(e.Item.OwnerTableView.Items(e.Item.ItemIndex)("SUserID").Controls(0), TextBox)

 

 

 

 

Dim hidSuserid = Val(CType(item.FindControl("hidSuserId"), HiddenField).Value)

 

 

Dim radioEnable = CType(item.FindControl("checkEnable"), RadioButton).Checked

 

 

Dim txtEmail As TextBox = CType(item.FindControl("txtEmail"), TextBox)

 

 

Dim lblmsg As Label = CType(item.FindControl("lblmsg"), Label)

 

 

'lblmsg.Text = hidSuserid

 

 

 

SqlQry =

"select Email from SiteUsers where Email='" & txtEmail.Text & "' and SuserId <> " & hidSuserid

 

 

If oDB.ExecuteScaler(SqlQry) = "" Then

 

 

 

SqlQry =

"Update SiteUsers Set Email='" & txtEmail.Text & "',userstatus=" & IIf(radioEnable = True, 0, 1) & " where SUserId = " & hidSuserid

 

oDB.ExecuteNonQuery(SqlQry)

item.Edit =

False

 

 

 

RadGrid1.rebind()

 

Else

 

 

 

lblmsg.Text =

"Email Already Exists"

 

 

 

 

End If

 

 

 

 

End Sub

 

 

 

 

Protected Sub RadGrid1_DeleteCommand(ByVal source As Object, ByVal e As Telerik.Web.UI.GridCommandEventArgs) Handles RadGrid1.DeleteCommand

 

 

Dim item As GridDataItem = DirectCast(e.Item, GridDataItem)

 

 

Try

 

 

 

hidUpdateuser.Value =

""

 

 

 

SqlQry =

"DELETE from SiteUsers where SuserId='" & e.Item.Cells(4).Text & "'"

 

 

 

oDB.ExecuteNonQuery(SqlQry)

hidUpdateuser.Value =

"Deleted"

 

 

 

 

Catch ex As Exception

 

RadGrid1.Controls.Add(

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

 

e.Canceled =

True

 

 

 

 

End Try

 

 

 

 

End Sub

 

 

 

 

 

 

 

Protected Sub RadGrid1_InsertCommand(ByVal source As Object, ByVal e As Telerik.Web.UI.GridCommandEventArgs) Handles RadGrid1.InsertCommand

 

e.Canceled =

True

 

 

 

 

Dim SqlQry As String = ""

 

 

 

 

Dim editedItem As GridEditableItem = CType(e.Item, GridEditableItem)

 

 

Dim txtEmail As TextBox = CType(editedItem.FindControl("txtEmail"), TextBox)

 

 

Dim txtPassword As TextBox = CType(editedItem.FindControl("txtPassword"), TextBox)

 

 

'Password = NDCryption.Encrypt(txtPassword.Text)

 

 

 

SqlQry =

"insert into SiteUsers([ClientID], [Email], [Password], [UserStatus],[UserType],[Authenticate]) values (0,'" & txtEmail.Text.Trim & "','" & NDCryption.Encrypt(txtPassword.Text) & "'," & UserStatue.Enabled & "," & UserType.PowerAdmin & "," & UserAuthenticate.CMSSite & ")"

 

 

 

oDB.ExecuteNonQuery(SqlQry)

editedItem.Edit =

False

 

 

 

RadGrid1.rebind()

 

End Sub

 

Princy
Top achievements
Rank 2
 answered on 20 Oct 2008
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?