Telerik Forums
UI for ASP.NET AJAX Forum
4 answers
62 views
Hi,

 I created as RadSlider as below

<telerik:RadSplitter ID="RadS_Filter" runat="server" Height="22px"
Orientation="Horizontal" Width="820px">
<telerik:RadPane ID="RadP_Filter" runat="server" Height="22px" Scrolling="none">
<telerik:RadSlidingZone ID="RadSZ_Filter" runat="server" Height="22px"
SlideDirection="Bottom" Font-Size="Medium" Width="500px">
<telerik:RadSlidingPane ID="RadSP_Filter" runat="server"
BackColor="ButtonFace" Title="Filter" Height="120" OnClientDocked="changesizefilter" OnClientUndocked="ChangeUndockSizeFilter">
<table cellspacing="10" id="tbl_comboTable" runat="server">
<tr>
<td>
<asp:Label ID="lbl_FilParent" runat="server" Text="Parent"></asp:Label>
</td>
<td>
<telerik:RadComboBox ID="RadcmbFil_Parent" runat="server"  AutoPostBack="True" AllowCustomText="True"  onselectedindexchanged="RadcmbFil_Parent_SelectedIndexChanged" Width="300">
</telerik:RadComboBox>
</td>
<td>
<asp:Label ID="lbl_FilStudent" runat="server" Text="Student"></asp:Label>
</td>
<td>
<telerik:RadComboBox ID="RadcmbFil_Student" runat="server" Skin="Hay"  AllowCustomText="True" Height="22px" Width="300">
</telerik:RadComboBox>
</td>
</tr>
<tr>
<td>
<asp:Label ID="lbl_FilSubject" runat="server" Text="Subject"></asp:Label>
</td>
<td>
<telerik:RadComboBox ID="RadcmbFil_subject" runat="server"  AutoPostBack="True" AllowCustomText="True" Width="300">
</telerik:RadComboBox>
    </td>
    <td colspan="2">
            <asp:Button ID="btn_FilterSearch" runat="server" Text="Search" Width="100" />
    </td>
    </tr> 
            </table>
</telerik:RadSlidingPane>
</telerik:RadSlidingZone>
</telerik:RadPane>
</telerik:RadSplitter>

After this  i  used two Java script Functions for ClientDocked and Undocked

When the client Docks

function changesizefilter()
{
var splitter = $find("<%=RadS_Filter.ClientID%>");
var height = 150;
splitter.set_height(height);
__doPostBack(
'<UpdatePanel>',');
}

When The Click Undocks

 

 

function ChangeUndockSizeFilter()
{
var splitter = $find("<%=RadS_Filter.ClientID%>");
var height = 22;
splitter.set_height(height);
window.location.reload(
true);
}

But the problem is getting at onclientDocked.
 when the client docks the page is refreshing Multiple Times......Why it is happening..Does it acheives in other way?
Regards
Bhuvan

 

 

 

 

Bhuvan
Top achievements
Rank 1
 answered on 04 Jan 2011
2 answers
78 views
Hi all,
I want to design multi views for my Grid but I don't have idea to do that.
For example: we have 2 views (UI) for the Grid and User can choose which view to be viewed (of course, we only have one datasource)

P/S: sorry for my bad English

Any help will be appreciated
Thanks
Dan
Dan
Top achievements
Rank 1
 answered on 04 Jan 2011
1 answer
171 views
Hi All,

I am facing few problem in Grid. I would really appreciate if someone could help me out .

1. I want to add a HTML table in Mastertable view so that I can add static text in first cell and in other cell I can add the Columns for Grid Table View. Projects will be fixed text of first cell which should not change color of mouse over/ selection of row.
  Example :-  EmpName EmpEmail EmpNum---------------Mastertable view of Detail Table
                   Projects  ||     Sno.    Name       ------------- Grid Table View  
2. change background color of Mastertable Row of which Mastertable view row is selected.

Mira
Telerik team
 answered on 04 Jan 2011
5 answers
711 views
Hi all,

is there a way of manage (via code behind) the checkbox in the header that comes with a GridClientSelectColumn?
I couldn't find the right way. I also tried to manage it via an event but it doesn't fire.
Here's a snippet:

...code
GridHeaderItem headerItem = (GridHeaderItem)RadGridDocumentsControlForm.MasterTableView.GetItems(GridItemType.Header)[0];
CheckBox chkSelectAll = headerItem.FindControl("CheckedSelectCheckBox") as CheckBox;
chkSelectAll.Enabled = true;
chkSelectAll.CheckedChanged +=new EventHandler(chkSelectAll_CheckedChanged);
...code

//handler
void chkSelectAll_CheckedChanged(object sender, EventArgs e)
{
            //code
 }

Thanks in advance.

Dario Zanelli
Princy
Top achievements
Rank 2
 answered on 04 Jan 2011
5 answers
140 views
Hello,
 I have a red grid and that grid contains

MasterTableView - > EditFormSettings - > FormTemplate
in FormTemplate I have 2 Radiobutton and on this radio button should Visible true false a TR using js or jquery.
i enable to do that with red grid, plz give me suitable code of js or jquery to do my task...

My grid code is below.............

 

 

<telerik:RadGrid ID="grdPurchaseItems" runat="server" ShowStatusBar="True" AllowAutomaticUpdates="false"

 

 

AllowAutomaticInserts="false" AllowAutomaticDeletes="false" AllowPaging="True"

 

 

Skin="Outlook" AllowSorting="True" OnNeedDataSource="grdPurchaseItems_NeedDataSource"

 

 

OnItemCommand="grdPurchaseItems_ItemCommand" AutoGenerateColumns="false" OnItemDataBound="grdPurchaseItems_ItemDataBound"

 

 

Width="99%">

 

 

<GroupingSettings CaseSensitive="False"></GroupingSettings>

 

 

<MasterTableView DataKeyNames="Sno" EditMode="PopUp" CommandItemDisplay="Top">

 

 

<Columns>

 

 

<telerik:GridEditCommandColumn Visible="False" ButtonType="ImageButton">

 

 

</telerik:GridEditCommandColumn>

 

 

<telerik:GridBoundColumn DataField="Sno" UniqueName="Sno" HeaderText="S.No.">

 

 

</telerik:GridBoundColumn>

 

 

<telerik:GridBoundColumn DataField="ItemID" UniqueName="ItemID" Visible="False" HeaderText="ID">

 

 

<ItemStyle ForeColor="Gray"></ItemStyle>

 

 

<HeaderStyle Width="20px" ForeColor="WhiteSmoke"></HeaderStyle>

 

 

</telerik:GridBoundColumn>

 

 

<telerik:GridBoundColumn DataField="ItemCode" UniqueName="ItemCode" HeaderText="Item-Code">

 

 

</telerik:GridBoundColumn>

 

 

<telerik:GridBoundColumn DataField="ItemName" UniqueName="ItemName" HeaderText="Item Name">

 

 

</telerik:GridBoundColumn>

 

 

<telerik:GridBoundColumn DataField="Size" UniqueName="ItemSize" HeaderText="Size">

 

 

</telerik:GridBoundColumn>

 

 

<telerik:GridBoundColumn DataField="Unit" UniqueName="Unit" HeaderText="Unit">

 

 

</telerik:GridBoundColumn>

 

 

<telerik:GridBoundColumn DataField="Qty" UniqueName="Qty" HeaderText="Qty">

 

 

</telerik:GridBoundColumn>

 

 

<telerik:GridBoundColumn DataField="RatePerUnit" UniqueName="RatePerUnit" HeaderText="Rate/Unit">

 

 

</telerik:GridBoundColumn>

 

 

<telerik:GridBoundColumn DataField="Discount" UniqueName="Discount" HeaderText="Discount(%)">

 

 

</telerik:GridBoundColumn>

 

 

<telerik:GridBoundColumn DataField="NetRatePerUnit" UniqueName="NetRatePerUnit" HeaderText="Net Rate/Unit">

 

 

</telerik:GridBoundColumn>

 

 

<telerik:GridBoundColumn DataField="TotalAmt" UniqueName="TotalAmt" HeaderText="Total Amt."

 

 

Visible="false">

 

 

</telerik:GridBoundColumn>

 

 

<telerik:GridBoundColumn DataField="TaxRate" UniqueName="TaxRate" HeaderText="Tax Rate(%)">

 

 

</telerik:GridBoundColumn>

 

 

<telerik:GridBoundColumn DataField="TaxAmt" UniqueName="TaxAmt" HeaderText="Tax Amt."

 

 

Visible="false">

 

 

</telerik:GridBoundColumn>

 

 

<telerik:GridBoundColumn DataField="GrossAmt" UniqueName="GrossAmt" HeaderText="Gross Amt."

 

 

Visible="false" />

 

 

<telerik:GridBoundColumn DataField="Adjustment" UniqueName="Adjustment" HeaderText="Adjustment"

 

 

Visible="false" />

 

 

<telerik:GridBoundColumn DataField="GrandTotal" UniqueName="GrandTotal" HeaderText="GrandTotal"

 

 

Visible="false" />

 

 

<telerik:GridButtonColumn UniqueName="column" Text="Delete" CommandName="Delete"

 

 

ButtonType="ImageButton">

 

 

</telerik:GridButtonColumn>

 

 

</Columns>

 

 

<HeaderStyle HorizontalAlign="Center"></HeaderStyle>

 

 

<EditFormSettings EditFormType="Template">

 

 

<FormTemplate>

 

 

<table id="table2" cellspacing="2" cellpadding="1" width="100%" border="1" rules="none"

 

 

style="border-collapse: collapse; background: white;">

 

 

<tr>

 

 

<td colspan="2" style="font-size: small">

 

 

<b>Item Details</b></td>

 

 

</tr>

 

 

<tr>

 

 

<td colspan="2">

 

 

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

 

 

<tr>

 

 

<td colspan="5">

 

 

<asp:ValidationSummary ID="ValidationSummary2" runat="server" ShowMessageBox="True"

 

 

ShowSummary="False" ValidationGroup="vsum1" />

 

 

</td>

 

 

<td>

 

 

<asp:HiddenField ID="hdnSno" runat="server" Value='<%# Bind( "Sno" ) %>' />

 

 

</td>

 

 

</tr>

 

 

<tr>

 

 

<td class="tdleft">

 

 

&nbsp;Item Category<span style="color: #ff0000"> *</span></td>

 

 

<td class="tdleft">

 

 

<asp:DropDownList ID="cmbItemCategory" CssClass="setcombo" DataSource='<%# f_BindItemCategory(0) %>'

 

 

DataTextField="ItemCatName" DataValueField="ItemCatID" runat="server" AutoPostBack="true"

 

 

OnSelectedIndexChanged="cmbItemCategory_SelectedIndexChanged">

 

 

<asp:ListItem Selected="True" Text="Select" Value="0"></asp:ListItem>

 

 

</asp:DropDownList>

 

 

<asp:RequiredFieldValidator ID="rfvItemCategory" InitialValue="0" runat="server"

 

 

ControlToValidate="cmbItemCategory" Display="Dynamic" ErrorMessage="Please Select Item Category"

 

 

ValidationGroup="vsum1"><span style="COLOR: #ff0000"> *</span></asp:RequiredFieldValidator>

 

 

</td>

 

 

<td class="tdleft">

 

 

&nbsp;Item<span style="color: #ff0000"> *</span></td>

 

 

<td class="tdleft">

 

 

<asp:DropDownList ID="cmbItem" runat="server" AutoPostBack="true" CssClass="setcombo"

 

 

OnSelectedIndexChanged="cmbItem_SelectedIndexChanged">

 

 

<asp:ListItem Selected="True" Text="Select" Value="0"></asp:ListItem>

 

 

</asp:DropDownList>

 

 

<asp:RequiredFieldValidator ID="rfvItem" InitialValue="0" runat="server" ControlToValidate="cmbItem"

 

 

Display="Dynamic" ErrorMessage="Please Select Item" ValidationGroup="vsum1"><span style="COLOR: #ff0000"> *</span></asp:RequiredFieldValidator>

 

 

</td>

 

 

<td class="tdleft">

 

 

&nbsp;Item Code</td>

 

 

<td class="tdleft">

 

 

<asp:TextBox ID="ItemCode" runat="server" Text='<%# Bind( "ItemCode" ) %>' CssClass="textbox">

 

 

</asp:TextBox>

 

 

</td>

 

 

</tr>

 

 

<tr>

 

 

<td class="tdleft">

 

 

&nbsp;Item Name</td>

 

 

<td class="tdleft">

 

 

<asp:TextBox ID="ItemName" runat="server" Text='<%# Bind( "ItemName" ) %>' CssClass="textbox">

 

 

</asp:TextBox></td>

 

 

<td class="tdleft">

 

 

&nbsp;Size</td>

 

 

<td class="tdleft">

 

 

<asp:TextBox ID="Size" runat="server" Text='<%# Bind( "Size") %>' CssClass="textbox">

 

 

</asp:TextBox></td>

 

 

<td class="tdleft">

 

 

&nbsp;Unit</td>

 

 

<td class="tdleft">

 

 

<asp:TextBox ID="Unit" runat="server" Text='<%# Bind( "Unit") %>' CssClass="textbox">

 

 

</asp:TextBox></td>

 

 

</tr>

 

 

<tr>

 

 

<td colspan="6">

 

 

</td>

 

 

</tr>

 

 

<tr>

 

 

<td class="tdleft">

 

 

&nbsp;Quantity<span style="color: #ff0000"> *</span></td>

 

 

<td class="tdleft">

 

 

<asp:TextBox ID="Qty" runat="server" Text='<%# Bind( "Qty") %>' AutoPostBack="true"

 

 

CssClass="textbox" OnTextChanged="Qty_TextChanged" onkeypress="javascript:return numeric_only(event)">

 

 

</asp:TextBox>

 

 

<asp:RequiredFieldValidator ID="rfvQty" runat="server" ControlToValidate="Qty" Display="Dynamic"

 

 

ErrorMessage="Please Enter Quantity" ValidationGroup="vsum1"><span style="COLOR: #ff0000"> *</span></asp:RequiredFieldValidator>

 

 

<asp:CompareValidator ID="cvQty" runat="server" Operator="GreaterThan" SetFocusOnError="True"

 

 

Display="Dynamic" ErrorMessage="Please Input At Least 1 Qty." ValueToCompare="0"

 

 

ValidationGroup="vsum1" ControlToValidate="Qty"><span style="COLOR: #ff0000"> *</span></asp:CompareValidator>

 

 

</td>

 

 

<td class="tdleft">

 

 

&nbsp;Rate/Unit</td>

 

 

<td class="tdleft">

 

 

<asp:TextBox ID="RatePerUnit" runat="server" Text='<%# Bind( "RatePerUnit") %>' AutoPostBack="true"

 

 

CssClass="textbox" OnTextChanged="RatePerUnit_TextChanged" onkeypress="return numeric_only(event);">

 

 

</asp:TextBox></td>

 

 

<td class="tdleft">

 

 

&nbsp;Discount</td>

 

 

<td class="tdleft">

 

 

<asp:TextBox ID="Discount" runat="server" Text='<%# Bind( "Discount") %>' AutoPostBack="true"

 

 

CssClass="textbox" OnTextChanged="Discount_TextChanged" onkeypress="return numeric_only(event);">

 

 

</asp:TextBox>%</td>

 

 

</tr>

 

 

<tr>

 

 

<td colspan="6">

 

 

</td>

 

 

</tr>

 

 

<tr>

 

 

<td class="tdleft">

 

 

&nbsp;Net Rate/Unit</td>

 

 

<td class="tdleft">

 

 

<asp:TextBox ID="NetRatePerUnit" runat="server" Text='<%# Bind( "NetRatePerUnit") %>'

 

 

CssClass="textbox" ReadOnly="true" onkeypress="return numeric_only(event);">

 

 

</asp:TextBox></td>

 

 

<td class="tdleft">

 

 

&nbsp;Total Amount</td>

 

 

<td class="tdleft">

 

 

<asp:TextBox ID="TotalAmt" runat="server" Text='<%# Bind( "TotalAmt") %>' CssClass="textbox"

 

 

ReadOnly="true" onkeypress="return numeric_only(event);">

 

 

</asp:TextBox></td>

 

 

<td class="tdleft">

 

 

&nbsp;Tax Rate<span style="color: #ff0000"> *</span></td>

 

 

<td class="tdleft">

 

 

<asp:DropDownList ID="cmbTaxRate" runat="server" CssClass="setcombo" AutoPostBack="true"

 

 

OnSelectedIndexChanged="cmbTaxRate_SelectedIndexChanged" DataSource='<%# f_BindTaxRate() %>'

 

 

DataTextField="TaxRate" DataValueField="TaxRateID">

 

 

<asp:ListItem Selected="True" Text="Select" Value="0"></asp:ListItem>

 

 

</asp:DropDownList>%<asp:RequiredFieldValidator ID="rfvTaxRate" InitialValue="0"

 

 

runat="server" ControlToValidate="cmbTaxRate" Display="Dynamic" ErrorMessage="Please Select Tax Rate"

 

 

ValidationGroup="vsum1"><span style="COLOR: #ff0000"> *</span></asp:RequiredFieldValidator></td>

 

 

</tr>

 

 

<tr>

 

 

<td colspan="6">

 

 

</td>

 

 

</tr>

 

 

<tr>

 

 

<td class="tdleft">

 

 

&nbsp;Tax Amount</td>

 

 

<td class="tdleft">

 

 

<asp:TextBox ID="TaxAmt" runat="server" Text='<%# Bind( "TaxAmt") %>' CssClass="textbox"

 

 

ReadOnly="true" onkeypress="javascript:return numeric_only(event);">

 

 

</asp:TextBox></td>

 

 

<td class="tdleft">

 

 

&nbsp;Gross Amount</td>

 

 

<td class="tdleft">

 

 

<asp:TextBox ID="GrossAmt" runat="server" Text='<%# Bind( "GrossAmt") %>' CssClass="textbox"

 

 

ReadOnly="true" onkeypress="return numeric_only(event);">

 

 

</asp:TextBox></td>

 

 

<td class="tdleft">

 

Excies Applicable

</td>

 

 

<td class="tdleft">

 

 

<asp:RadioButton ID="rbtnYes" runat="server" Text="Yes" Checked="true" GroupName="Excies"

 

 

onclick="show(this,'Yes');" />

 

 

<asp:RadioButton ID="rbtnNo" runat="server" Text="No" GroupName="Excies" onclick="show(this,'No');" />

 

 

</td>

 

 

</tr>

 

 

<tr id="trExcies" runat="server" visible="false">

 

 

<td>

 

 

</td>

 

 

<td>

 

 

</td>

 

 

<td>

 

 

</td>

 

 

<td>

 

 

</td>

 

 

<td>

 

Excise Tax rate

</td>

 

 

<td>

 

 

<asp:TextBox ID="txtExciseTaxRate" runat="server" />%

 

 

<asp:RequiredFieldValidator ID="rfvExciseTaxRate" runat="server" SetFocusOnError="true"

 

 

Display="Dynamic" ControlToValidate="txtExciseTaxRate" ErrorMessage="Please enter Excise Tax Rate" />

 

 

</td>

 

 

</tr>

 

 

</table>

 

 

</td>

 

 

</tr>

 

 

<tr>

 

 

<td align="right" colspan="2">

 

 

<asp:Button ID="btnUpdate" Text='<%# (Container is GridEditFormInsertItem) ? "Insert" : "Update" %>'

 

 

runat="server" CommandName='<%# (Container is GridEditFormInsertItem) ? "PerformInsert" : "Update" %>'

 

 

OnClick="btnUpdate_Click" ValidationGroup="vsum1"></asp:Button>&nbsp;

 

 

<asp:Button ID="btnCancel" Text="Cancel" runat="server" CausesValidation="False"

 

 

CommandName="Cancel"></asp:Button></td>

 

 

</tr>

 

 

</table>

 

 

</FormTemplate>

 

 

<PopUpSettings Modal="True" Width="80%"></PopUpSettings>

 

 

<FormStyle Width="100%"></FormStyle>

 

 

<EditColumn UniqueName="EditCommandColumn1">

 

 

</EditColumn>

 

 

</EditFormSettings>

 

 

</MasterTableView>

 

 

</telerik:RadGrid>


thanks
Amit

 

Princy
Top achievements
Rank 2
 answered on 04 Jan 2011
2 answers
71 views
Hi,

I am using a hierarchical rad grid and saving some grid's statuses (filter function,sort expression,page size....) according to users.
I need to save and reload the column order of grid (After drag and drop columns)
I can save column order as a pipe separated string by using column indexes in to a xml string.

But when reloading the column order it gives exception that says mismatch with viewstate.
Can anyone give me a solution to achieve this task.

Regards,
Madu
madu
Top achievements
Rank 1
 answered on 04 Jan 2011
1 answer
99 views
Searched the forum, but couldn't find anything.

Is there a way to make to edit form popup window resizable?
I don't see any property under EditFormSettings or PopUpSettings to set this value.

I basically need the user to be able to increase or decrease the size of the popup.

Thanks
Shinu
Top achievements
Rank 2
 answered on 04 Jan 2011
5 answers
227 views
Dear Telerik,

     Am using RadTimePicker,RadDateTimePicker and RadDatePicker. I cant find the control in dynamically. I need DisplayDateFormat from database side. If i find the control is RadTimePicker, that ll execute on all loops like that control is RadTimePicker and RadDateTimePicker and RadDatePicker. so i cant set DisplayDateFormat properly. pls solve this problem.

                     if (Ctrl is RadDatePicker)
                {
                    ((RadDatePicker)Ctrl).DateInput.DisplayDateFormat = "dd/MM/yyyy";
                }
                if (Ctrl is RadTimePicker)
                {
                    ((RadTimePicker)Ctrl).DateInput.DisplayDateFormat = "hh:mm tt";
                }
                if (Ctrl is RadDateTimePicker)
                {
                    ((RadDateTimePicker)Ctrl).DateInput.DisplayDateFormat="dd/MM/yyyy hh:mm tt "
                }
vinoth sansar
Top achievements
Rank 2
 answered on 04 Jan 2011
5 answers
618 views
Hello!
I'd been searching for a couple of days to find a solution to what is think is a "simple" problem, that due to my lack of knowledge is toooo hard to solve it without help.
What i need to accomplish is:
Open a RadWindow with my login page, 
Get the login and password
Authenticate
-if succeed: redirect
-if fails: display a message ( i have label for that purpose) and keep the RadWindow open.

My problem is that i can't find a way to process the authentication and automatically close the window and redirect.
Because client-side functions run before server-side, i can't perform the authentication in my db and then execute the JavaScript functions with the same button. I know I can look for a javascript snippet to perform the authentication, but i don't want to take that path 'cause at this point i'm blind to javascript. so i want to reduce it at the very minimum possible. I'd tried the techniques to execute JS functions from code-behind with no luck. Even run sever-side functions from JS but i just can't make it work.
What i have so far:
Parent Page
<script language="javascript" type="text/javascript">
        function OpenLogin()
         {
           var wnd = $find("<%=dlgLogin.ClientID%>");
                wnd.setUrl("Login.aspx");
                wnd.show();
            }
            function IsOk(wnd, Arg) {
               var args = Arg.get_argument();
                if (args) {
                    window.location = "CustomerStatus.aspx";
                }
            }     
    </script>
<script language="javascript" type="text/javascript">
        function OpenLogin()
         {
           var wnd = $find("<%=dlgLogin.ClientID%>");
                wnd.setUrl("Login.aspx");
                wnd.show();
            }
            function IsOk(wnd, Arg) {
               var args = Arg.get_argument();
                if (args) {
                    window.location = "CustomerStatus.aspx";
                }
            }    
    </script>

Child Page aspx
<script language="javascript" type="text/javascript">
    
    function GetRadWindow() {
        var oWindow = null;
        if (window.radWindow) oWindow = window.radWindow;
        else if (window.frameElement.radWindow) oWindow = window.frameElement.radWindow;
        return oWindow;
    }
    function CancelWindow() {
       var wnd = GetRadWindow();
        wnd.close();
    }
    function CloseWndw() {
        var arg = document.getElementById("txtIsOk").value;
        if (arg) {
            var wnd = GetRadWindow();
            wnd.close(arg);
        }
    }
    function Waiting(s, e)
        {
            Callback.PerformCallback();
            LPWaitConn.Show();
 
        }
                       
</script>

The  hidden-Field and RadButtons
 <asp:ScriptManager ID="ScriptManager1" runat="server">
    </asp:ScriptManager>
       
    <asp:UpdatePanel ID="UpdatePanel1" runat="server">
 
<asp:ScriptManager ID="ScriptManager1" runat="server">
    </asp:ScriptManager>
        
    <asp:UpdatePanel ID="UpdatePanel1" runat="server">
    <ContentTemplate>
<asp:HiddenField ID="txtIsOk" runat="server" />
 <telerik:RadButton ID="btnLogin" runat="server" Text="Submit" Style="z-index: 1;
                left: 243px; top: 134px; position: absolute; height: 19px" BackColor="Transparent"
                Font-Names="Verdana" Font-Size="10pt" ForeColor="#84DA2E" SkinID="Black" OnClientClicking="Waiting"
                OnClick="btnLogin_Click" OnClientClicked="CloseWndw">
            </telerik:RadButton>
             
            <telerik:RadButton ID="btnCancel" runat="server" Text="Cancel" Style="z-index: 1;
                left: 180px; top: 134px; position: absolute; height: 19px" BackColor="Transparent"
                Font-Names="Verdana" Font-Size="10pt" ForeColor="#84DA2E" Font-Bold="True" Skin="Black"
                EnableViewState="False" OnClientClicked="CancelWindow">
            </telerik:RadButton>
</ContentTemplate>
    </asp:UpdatePanel>

<script language="javascript" type="text/javascript">
        function OpenLogin()
         {
           var wnd = $find("<%=dlgLogin.ClientID%>");
                wnd.setUrl("Login.aspx");
                wnd.show();
            }
            function IsOk(wnd, Arg) {
               var args = Arg.get_argument();
                if (args) {
                    window.location = "CustomerStatus.aspx";
                }
            }     
    </script>
Code-Behind
Protected Sub btnLogin_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnLogin.Click
       Dim strCon As String = String.Empty
       Dim cnn As SqlConnection
 
       If Me.txtIsOk.Value.Length > 0 Then Exit Sub 'Because of the forced postback this is avoid more than one execution
 
       If Me.txtUser.Text.Length > 0 AndAlso Me.txtPass.Text.Length > 0 Then
           strCon = "Data Source=MyServer;Initial Catalog=MyDb;User Id=" & Me.txtUser.Text & ";Password=" & Me.txtPass.Text & ";"
           cnn = New SqlConnection(strCon)
           Try
               cnn.Open()
               Me.txtIsOk.Value = "Yes"
           Catch ex As SqlException
               Me.lblWarning.Text = "Wrong Login or Password"
               Me.lblWarning.Visible = True
           Catch ex1 As Exception
               Me.lblWarning.Text = "Wrong Login or Password"
               Me.lblWarning.Visible = True
           Finally
               cnn.Close()
               cnn.Dispose()
           End Try
       End If
   End Sub
The problem with my code is that i have to click twice in the "btnLogin".
In the first click everything will run, but the client-side will execute first and nothing will happen in that side. At the same time if credentials are ok the hidden field will be populated.
In the second click: Again everything will run this time as expected.

For any help
Thanks in advance




Jet
Top achievements
Rank 2
 answered on 04 Jan 2011
2 answers
116 views
Hi All,

Please Please Help ....

I have to update data from Grid.
I have added GridEditCommandColumn in RadGrid. When I browse to Edit data and Click Update data not change in both RadGrid and Database.
Please advice what properties or event I must add?

On the same page I have added (VisualStudio) GridView and do as I did in RadGrid, use same datasourceControl as RadGrid used, updating data worked fine at GridView.

This very simple, updating one by one record I still cannot do it  :(   ...  The actually program I want to do is user may update more than one records, the update data will be affect on RadGrid only, data will just save into database when user click save button.

Any idea please please ...

Thanks and Best Regards....
Naunton
Top achievements
Rank 1
 answered on 04 Jan 2011
Narrow your results
Selected tags
Tags
+? more
Top users last month
Will
Top achievements
Rank 2
Iron
Motti
Top achievements
Rank 1
Iron
Hester
Top achievements
Rank 1
Iron
Bob
Top achievements
Rank 3
Iron
Iron
Veteran
Thomas
Top achievements
Rank 2
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Will
Top achievements
Rank 2
Iron
Motti
Top achievements
Rank 1
Iron
Hester
Top achievements
Rank 1
Iron
Bob
Top achievements
Rank 3
Iron
Iron
Veteran
Thomas
Top achievements
Rank 2
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?