Telerik Forums
UI for ASP.NET AJAX Forum
1 answer
104 views

I have a custom dialog to upload any type of video and convert it to a .fla and insert it into the RadEditor. I have all the code completed and everything works fine to a point.

I think this is an easy one.

After the video is converted and saved I set a hiddenfield with the path and video name. When i try to set - closeArgument.videopath to the hiddenfield it is nothing.

I checked and the hiddenfield is being set. Why cant I get the value of the hiddenfield that was set serverside?

 

closeArgument.videopath = document.getElementById(

"savefolder").value;

Thanks for your help

 

 

 

 

 

Rumen
Telerik team
 answered on 17 Oct 2008
1 answer
156 views
You can't add dock.TitlebarContainer.controls.add if dock.resizable = true;

Please pay attention to this bug.

The next thing I want to add is according the resizing the control.
Well if I put raddock control into some div which can be resized and raddock mode is docked I can't change its width via java script.

Can you write a sample of resizing the raddock via undocking and docking via java script.

Sample: User Comtrol inside the raddock. User Control has a button. when I make click on the button I want the raddock will be resize to 300X300 let's say.

Thanks. It is very important and I think not only for me.
Obi-Wan Kenobi
Top achievements
Rank 1
 answered on 17 Oct 2008
1 answer
161 views
Hi,

I am using RadTreeView control in radCombobox. I have used the example 
http://demos.telerik.com/ASPNET/Prometheus/Treeview/Examples/Functionality/TreeViewComboBox/DefaultCS.aspx

I have used StopPropagation function from the above example in order to stop the node text as concatenated string of all nodes.
This is not working in firefox browser.

What should I do?

Thanks,
Pankaj
Veselin Vasilev
Telerik team
 answered on 17 Oct 2008
3 answers
77 views
I placed a 3 buttons with absolute position . its working fine.
But when I drag and drop the Form decorator,and run the application,
All the button controls are behind one after one in one place.

Pls advise how to design the button at a required place using formdecorator

Thanks in advance
Georgi Tunev
Telerik team
 answered on 17 Oct 2008
3 answers
117 views
I have multiple RadEditors in my WebPage.
All of them have the same ToolBar. I want to use the ToolProviderID property to achieve faster page load.
I am treating one as the master Editor. For this control, I assign the ToolsFile property in PageLoad.
And for other controls I use the ToolProviderID property. this gets assigned as the button click event.
The tool bar gets loaded properly but it does not loads the Languages from the main toolbar.

Any inputs?

Thanks!!
George
Telerik team
 answered on 17 Oct 2008
0 answers
60 views

I am using  RadFormDecorator with WebBlue as skin..
My problem is asp:Button is scrolling which is placed in RadPanelItem when we scroll the page. 

 Thanks 
Naryana 

Satish
Top achievements
Rank 1
 asked on 17 Oct 2008
3 answers
110 views
Greetings,

So, the problem I'm having right now is an odd one, or at least to me.  I have a page with a RadGrid in it, that has it's editmode turned to popup that calls a control of mine.  Upon the window appearing, I get a javascript error.  This error comes from some javascript that I'm trying to add within a radToolBar.  Here is what I have.

<script type="text/javascript">  
    function onClientButtonClick(sender, args)  
    {  
        var btn = args.get_item();  
        if (btn.get_commandName() == "PerformInsert")  
        {  
            var txt = $find("ctl00_ctl00_cphContent2_cphAITContent_rgdComments_ctl00_ctl02_ctl03_EditFormControl_txtComment_text");  
            var temp = txt.value.replace('/^\s+|\s+$/g', '');  
            if (temp.value.length == 0)  
            {  
                alert("You must enter text in order to add/edit your comment.");  
            }  
        }  
    }  
</script> 
 
<telerik:RadToolBar ID="rtbCommentText" runat="server" OnButtonClick="rtbCommentText_ButtonClick" 
        OnClientButtonClicked="onClientButtonClick">  
        <Items> 
            <telerik:RadToolBarButton CommandName="PerformInsert" Text="Save" SkinID="SaveBtn">  
            </telerik:RadToolBarButton> 
            <telerik:RadToolBarButton CommandName="Cancel" Text="Cancel" SkinID="CancelBtn">  
            </telerik:RadToolBarButton> 
        </Items> 
    </telerik:RadToolBar> 
    <br /> 
    <telerik:RadTextBox ID="txtComment" runat="server" TextMode="MultiLine" Width="500px" Height="250px">  
    </telerik:RadTextBox> 

Prior to adding the javascript codeblock, the page worked, but I need to check txtComment to find out if it has anything in itself or not on the clientside so I can do an alert.  Is there a way to do this?  Thanks.

Chad
Iana Tsolova
Telerik team
 answered on 17 Oct 2008
2 answers
195 views
Hi
   I am not able to add the new users in my grid while using inplace edit.
I am getting  'No default member found for type 'GridInsertionObject''
When I click on Add new users.

Here is my code.

<

telerik:RadAjaxManager id="RadAjaxManager1" runat="server">

 

 

<AjaxSettings>

 

 

<telerik:AjaxSetting AjaxControlID="RadGrid1">

 

 

<UpdatedControls>

 

 

<telerik:AjaxUpdatedControl ControlID="RadGrid1" LoadingPanelID="RadAjaxLoadingPanel1"/>

 

 

</UpdatedControls>

 

 

</telerik:AjaxSetting>

 

 

</AjaxSettings>

 

 

</telerik:RadAjaxManager>

 

 

<telerik:RadAjaxLoadingPanel ID="RadAjaxLoadingPanel1" runat="server" Height="75px" Width="75px" Transparency="50">

 

 

<img alt="Loading..." src='<%= RadAjaxLoadingPanel.GetWebResourceUrl(Page, "Telerik.Web.UI.Skins.Default.Ajax.loading.gif") %>' style="border:0;" />

 

 

</telerik:RadAjaxLoadingPanel>

 

 

<telerik:RadGrid ID="RadGrid1" CssClass="RadGrid" EnableTheming="False" EnableEmbeddedBaseStylesheet="False" AllowSorting="True" AllowMultiRowSelection="true" AllowMultiRowEdit="true"

 

 

runat="server" Width="98%" AllowPaging="True" AutoGenerateColumns="False" PageSize="5" AllowAutomaticDeletes="True" >

 

 

<ItemStyle CssClass="RadGridItem"></ItemStyle>

 

 

<HeaderStyle CssClass="RadGridHeader"></HeaderStyle>

 

 

<PagerStyle Mode="Slider" alwaysvisible="True" pagebuttoncount="5" CssClass="RadGridPager"></PagerStyle>

 

 

<ClientSettings EnablePostBackOnRowClick="false">

 

 

<Selecting AllowRowSelect="true" />

 

 

</ClientSettings>

 

 

<MasterTableView CommandItemDisplay="Top" DataKeyNames="SUserID" EditMode="InPlace" AutoGenerateColumns="False" Width="100%">

 

 

<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" Skin="WebBlue" 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" 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="LinkButton3" runat="server" CommandName="PerformInsert" Visible='<%# RadGrid1.MasterTableView.IsItemInserted %>'><img style="border:0px;vertical-align:middle;" alt="" src="../Images/icons/Add.gif" /> Add this 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" OnClientClick="javascript:return confirm('Are You Sure ?');"

 

 

runat="server" CommandName="DeleteSelected" CausesValidation="false" ><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:GridTemplateColumn UniqueName="Password" HeaderText="Password" >

 

 

<ItemTemplate>

 

 

<asp:HyperLink ID="hplReset" style="cursor:pointer" runat="server" Enabled='<%# Container.DataItem("SUserId") %>' OnClick='<%# "fn_Change(this," & Container.DataItem("SUserId") & ")" %>'

 

 

Text="Reset">

 

 

</asp:HyperLink>

 

 

</ItemTemplate>

 

 

<ItemStyle HorizontalAlign="Left" />

 

 

</telerik:GridTemplateColumn>

 

 

<telerik:GridTemplateColumn DataField="UserStatus" UniqueName="UserStatus" HeaderButtonType="TextButton" HeaderText="UserStatus" ><ItemTemplate>

 

 

<asp:Label ID="lblStatus" runat="server" text='<%# IIf(Container.DataItem("UserStatus")= 0,"Enabled","Disabled") %>' />

 

 

</ItemTemplate>

 

 

<EditItemTemplate >

 

 

<asp:RadioButton GroupName="grpuserstatus" runat="server" ID="checkDisable" text="Disabled" Checked='<%# IIf(Container.DataItem("UserStatus")= 0,"False","True") %>'/>

 

 

<asp:RadioButton GroupName="grpuserstatus" runat="server" ID="checkEnable" text="Enabled" Checked='<%# IIf(Container.DataItem("UserStatus")= 0,"True","False") %>'/>

 

 

</EditItemTemplate>

 

 

<ItemStyle HorizontalAlign="Left" />

 

 

</telerik:GridTemplateColumn>

 

 

 

 

</Columns>

 

 

<EditFormSettings >

 

 

<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="3" cellspacing="0" width="98%" border="0">

 

 

<tr><td style="height:20px;"></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" ></asp:TextBox>

 

 

<asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" ControlToValidate="txtEmail"

 

 

Display="Dynamic" CssClass="errormsg" ErrorMessage="Enter Email"></asp:RequiredFieldValidator><asp:RegularExpressionValidator ID="RegularExpressionValidator1" runat="server" ControlToValidate="txtEmail"

 

 

Display="Dynamic" CssClass="errormsg" ErrorMessage="Invalid Email" ValidationExpression="\w+([-+.']\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*"></asp:RegularExpressionValidator></td>

 

 

</tr>

 

 

<tr><td>

 

 

 

<table cellpadding="0" cellspacing="0" border="0" width="100%">

 

 

<tr><td align="right" width="20%">Password&nbsp;<font color="red" >*</font>:&nbsp;</td>

 

 

<td align="left" width="80%" ><asp:TextBox ID="txtPassword" TextMode="Password" runat="server" MaxLength="10" ></asp:TextBox><asp:RequiredFieldValidator Enabled="false"

 

 

ID="reqPassword" runat="server" CssClass="errormsg" ControlToValidate="txtPassword" Display="Dynamic" ErrorMessage="Enter Password"></asp:RequiredFieldValidator><asp:RegularExpressionValidator Enabled="false"

 

 

ID="regPassword" runat="server" ControlToValidate="txtPassword" CssClass="errormsg" Display="Dynamic" ErrorMessage="Invalid Password" ValidationExpression="\w{6,10}"></asp:RegularExpressionValidator></td></tr>

 

 

<tr><td align="right" width="20%">Retype Password&nbsp;<font color="red" >*</font>:&nbsp;</td>

 

 

<td align="left" width="80%" ><asp:TextBox ID="txtRePassword" TextMode="Password" runat="server" MaxLength="10" ></asp:TextBox><asp:RequiredFieldValidator Enabled="false"

 

 

ID="reqRePassword" runat="server" ControlToValidate="txtRePassword" CssClass="errormsg" Display="Dynamic" ErrorMessage="Enter Re-Type Password"></asp:RequiredFieldValidator><asp:RegularExpressionValidator Enabled="false"

 

 

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" Enabled="false" ></asp:CompareValidator></td></tr>

 

 

</table>

 

 

</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>

 

 

<updatedcontrols>

 

 

<telerik:AjaxUpdatedControl ControlID="RadGrid1" LoadingPanelID="RadAjaxLoadingPanel1"/>

 

 

</updatedcontrols>

 

 

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

 

 

</telerik:RadGrid>

 

 

</td></tr>

 

 

<tr><td style="height:150px" align="center"><asp:Label runat="server" ID="lblMsg" Text="" ForeColor="red"></asp:Label></td></tr>

 

 

</table>

 

 

<div id="popupWindow">

 

 

<telerik:RadWindowManager ID="RadWindowManager1" runat="server" Skin="WebBlue">

 

 

<PromptTemplate>

 

 

<script type="text/javascript">

 

 

function closePrompt(winid,winid1)

 

{

 

 

var select = document.getElementById('select' + winid);

 

 

var select2 = document.getElementById('select2' + winid1);

 

 

var passvalue = select.value

 

 

var passvalue1 = select2.value

 

 

if(passvalue == "")

 

{

document.getElementById (

"lblRadwindowpassword").innerHTML = "Enter Password"

 

document.getElementById(

'select' + winid).focus()

 

 

return false;

 

}

 

// if(passvalue.length < 6 || passvalue.length > 10)

 

 

// {

 

 

// document.getElementById ("lblRadwindowpassword").innerHTML = "Enter minimum Six to Ten !"

 

 

// document.getElementById('select' + winid).focus()

 

 

// return false;

 

 

// }

 

 

if(passvalue1 == "")

 

{

document.getElementById (

"lblRadwindowpassword").innerHTML = "Enter Retype Password"

 

document.getElementById(

'select2' + winid1).focus();

 

 

return false;

 

}

 

 

var data = passvalue.split('');

 

 

//start by setting false

 

passvalue.IsValid=

false;

 

 

//check length

 

document.getElementById (

"lblRadwindowpassword").innerHTML = "Minimum 8 characters with atleast one character/digit "

 

document.getElementById(

'select' + winid).focus()

 

 

if(data.length < 8 || data.length > 10) return;

 

 

//check for uppercase

 

 

var uc = false;

 

 

for(var c in data)

 

{

 

if(data[c] >= 'A' && data[c] <= 'Z' || data[c] >= 'a' && data[c] <= 'z')

 

{

uc=

true; break;

 

}

}

document.getElementById (

"lblRadwindowpassword").innerHTML = "Minimum 8 characters with atleast one character/digit"

 

document.getElementById(

'select' + winid).focus()

 

 

if(!uc) return;

 

 

//check for lowercase

 

 

// var lc = false;

 

 

// for(var c in data)

 

 

// {

 

 

// if(data[c] >= 'a' && data[c] <= 'z')

 

 

// {

 

 

// alert(lc)

 

 

// lc=true; break;

 

 

// }

 

 

// }

 

 

// if(!lc) return;

 

 

//check for numeric

 

 

var num = false;

 

 

for(var c in data)

 

{

 

if(data[c] >= '0' && data[c] <= '9')

 

{

num=

true; break;

 

}

}

document.getElementById (

"lblRadwindowpassword").innerHTML = "Minimum 8 characters with atleast one character/digit"

 

document.getElementById(

'select' + winid).focus()

 

 

if(!num) return;

 

 

//must be valid

 

passvalue.IsValid=

true;

 

 

 

if(passvalue != passvalue1)

 

{

document.getElementById (

"lblRadwindowpassword").innerHTML = "Password Mismatch"

 

document.getElementById(

'select2' + winid1).focus()

 

 

return false;

 

}

 

var ajaxi=updaterecords(passvalue,document.getElementById ("hiddsuserids").value)

 

 

// var selectselectedValue = select.options[select.selectedIndex].value;

 

 

// alert(selectselectedValue)

 

 

var confirmWnd = $find(winid);

 

confirmWnd.callBack(passvalue);

radalert(

'Your Password Updated Successfully !', 250, 100);

 

 

}

 

</script>

 

 

 

<div class="windowpopup radprompt">

 

 

<div class="dialogtext">

 

{1}

 

</div>

 

 

<div>

 

 

<table cellpadding ="0" cellspacing ="0" border ="0" width ="100%">

 

 

<tr><td style ="height:5px" colspan ="2">&nbsp;</td></tr>

 

 

<tr>

 

 

<td align ="right" ><span class="txtp">Password<span style ="color :Red">*</span>:&nbsp;</span></td>

 

 

<td><input type ="password" id="select{0}" maxlength ="10" class ="textbox"/></td>

 

 

</tr>

 

 

<tr><td style ="height:1px" colspan ="2">&nbsp;</td></tr>

 

 

<tr>

 

 

<td align ="right" ><span class="txtp">Retype Password<span style ="color :Red">*</span>:&nbsp;</span></td>

 

 

<td><input type ="password" id="select2{0}" maxlength ="10" class ="textbox"/></td>

 

 

</tr>

 

 

<tr><td style ="height:6px" colspan ="2">&nbsp;</td></tr>

 

 

<tr>

 

 

<td align ="center" colspan ="2" style="height :18px"><asp:Label ID="lblRadwindowpassword" runat ="server" CssClass="errormsg"></asp:Label></td>

 

 

</tr>

 

 

<tr><td style ="height:3px" colspan ="2">&nbsp;</td></tr>

 

 

<tr>

 

 

<td colspan ="2" align ="center" valign ="top">

 

 

<a onclick="closePrompt('{0}','{0}');" class="radwindowbutton" href="javascript:void(0);">

 

 

<span class="outerspan"><span class="innerspan">##LOC[OK]##</span></span></a>

 

 

<a onclick="$find('{0}').close();" class="radwindowbutton" href="javascript:void(0);"><span class="outerspan">

 

 

<span class="innerspan">##LOC[Cancel]##</span></span></a>

 

 

</td>

 

 

</tr>

 

 

<tr><td style ="height:3px" colspan ="2">&nbsp;</td></tr>

 

 

</table>

 

 

</div>

 

 

</div>

 

 

</PromptTemplate>

 

 

&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</telerik:RadWindowManager>

 

Please help

My server side code.

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)

 

 

If Not Page.IsPostBack Then

 

 

Select Case UCase(Request.QueryString("from"))

 

 

Case "ADD"

 

lblMsg.Text = library.GetXMLMessage(8)

 

Case "EDIT"

 

lblMsg.Text = library.GetXMLMessage(9)

 

Case "DELETE"

 

lblMsg.Text = library.GetXMLMessage(10)

 

End Select

 

 

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

 

Else

 

RadGrid1.Visible =

False

 

 

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 lblpass As Label

 

lblpass =

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

 

lblpass.Text = NDCryption.Decrypt(lblpass.Text)

 

If Trim(lblpass.Text) <> "" Then

 

lblpass.Text =

"".PadLeft(Len(lblpass.Text), "*")

 

 

End If

 

 

'Response.Write(e.Item.Cells(7).Text)

 

 

'e.Item.Cells(7).Style.Add("display", "none")

 

 

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

 

 

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

 

 

Dim editor As GridTextBoxColumnEditor = DirectCast(item.EditManager.GetColumnEditor("Email"), GridTextBoxColumnEditor)

 

 

Dim txtsid As TextBox

 

txtsid =

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

 

 

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

 

SqlQry =

"select Email from SiteUsers where Email='" & editor.TextBoxControl.Text & "' and SuserId <> " & txtsid.Text

 

 

If oDB.ExecuteScaler(SqlQry) = "" Then

 

SqlQry =

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

 

oDB.ExecuteNonQuery(SqlQry)

 

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

 

#

Region "******************** Ajax Function *****************************"

 

<Ajax.JavascriptMethod()> _

 

Function IsEmailExist(ByVal Email As String) As Boolean

 

 

Dim SqlQry As String = ""

 

SqlQry =

"Select * from SiteUsers where UPPER(Email) like '" & UCase(Email) & "'"

 

IsEmailExist = oDb.IsExist(SqlQry)

 

End Function

 

#

End Region

 

 

'Protected Sub btnAdd_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnAdd.Click

 

 

' If Page.IsValid Then

 

 

' Dim SqlQry As String = ""

 

 

' Dim Password As String = ""

 

 

' Dim SuserId As String = ""

 

 

' Password = NDCryption.Encrypt(txtPassword.Text)

 

 

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

 

 

' oDB.ExecuteNonQuery(SqlQry)

 

 

' Response.Redirect("ManagePAdmin.aspx?from=add&CID=" & Request.QueryString("CID") & "&SID=" & Request.QueryString("SID") & "&PID=" & Request.QueryString("PID"))

 

 

' End If

 

 

'End Sub

 

 

Protected Sub RadGrid1_PageIndexChanged(ByVal source As Object, ByVal e As Telerik.Web.UI.GridPageChangedEventArgs) Handles RadGrid1.PageIndexChanged

 

 

'e.Canceled = True

 

 

End Sub

 

 

 

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

 

 

Dim SqlQry As String = ""

 

 

Dim Password As String = ""

 

 

Dim SuserId 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)

 

End Sub

 

 

 

Private Sub RadGrid1_ItemCreated(ByVal sender As Object, ByVal e As Telerik.Web.UI.GridItemEventArgs) Handles RadGrid1.ItemCreated

 

 

If (TypeOf e.Item Is GridDataItem) Then

 

 

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

 

 

 

ElseIf (TypeOf e.Item Is GridEditableItem AndAlso e.Item.IsInEditMode) Then

 

 

'the item is in edit mode

 

 

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

 

 

'do something here

 

 

End If

 

 

End Sub

 

 

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

 

 

Select Case e.CommandName

 

 

Case RadGrid.InitInsertCommandName

 

 

 

Case RadGrid.EditSelectedCommandName

 

e.Item.OwnerTableView.IsItemInserted =

False

 

 

End Select

 

 

End Sub

 

End

Class

 


nallamani
Top achievements
Rank 1
 answered on 17 Oct 2008
8 answers
170 views
I have just started using the RadToolBar from the Q1 2008 release.  It seems that when I set both the ImageUrl and the NavigateUrl for a RadToolBarButton, no navigation happens when the button is clicked on.  If I only have Text, the Navigate works properly.

Any ideas?

Thanks!

Jim
Helen
Telerik team
 answered on 17 Oct 2008
3 answers
70 views
Hi,
Click on Show more link of office calendar form in Month option is showing the previous days appointment details not the current.
We are customising the office Calenader.
How to rectify the issue.
Thanks,
Puru
Peter
Telerik team
 answered on 17 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?