Telerik Forums
UI for ASP.NET AJAX Forum
2 answers
179 views
Hello Everybody,
In my Project i am using rad grid control. in the grid Dynamically I created text boxes and buttons for adding and editing i don't know how to put validations in java script. I used  the following code and it is not working. can you please help me

<telerik:RadGrid ID="SpGrid" runat="server" AllowMultiRowSelection="False"
    AllowPaging="True" AllowSorting="True" AutoGenerateColumns="false" PageSize="7"
    ShowStatusBar="true" Skin="Outlook">
    <HeaderContextMenu CssClass="GridContextMenu GridContextMenu_Default">
    </HeaderContextMenu>
    <PagerStyle Mode="NumericPages" />
    <MasterTableView AllowMultiColumnSorting="True" CommandItemDisplay="Top" DataKeyNames="SPECIALITY_ID"
        Name="Specialist">
        <Columns>
            <telerik:GridEditCommandColumn HeaderText="Edit" UniqueName="EditCommandColumn">
                <ItemStyle Width="50px" />
            </telerik:GridEditCommandColumn>
            <telerik:GridBoundColumn DataField="SPECIALITY_ID"
                HeaderButtonType="TextButton" HeaderText="SPECIALITY ID"
                SortExpression="SPECIALITY_ID" UniqueName="SPECIALITY_ID">
            </telerik:GridBoundColumn>
            <telerik:GridBoundColumn DataField="SPECIALITY_DESC"
                HeaderButtonType="TextButton" HeaderText="DESCRIPTION"
                SortExpression="SPECIALITY_DESC" UniqueName="SPECIALITY_DESC">
            </telerik:GridBoundColumn>
            <telerik:GridButtonColumn ButtonType="ImageButton" CommandName="Delete"
                ConfirmText="Delete this Specialist ?" Text="Delete" UniqueName="DeleteColumn1">
                <HeaderStyle Width="20px" />
                <ItemStyle CssClass="MyImageButton" HorizontalAlign="Center" />
            </telerik:GridButtonColumn>
        </Columns>
        <EditFormSettings EditFormType="Template">
            <FormTemplate>
                <table ID="tblSpecialitymaster" border="1" cellpadding="1" cellspacing="2"
                    rules="none" style="border-collapse: collapse; background: white;" width="100%">
                    <tr class="EditFormHeader">
                        <td colspan="2" style="font-size: small; font-family: Verdana;color:Maroon">
                            <b>SpecialityDetail</b>
                        </td>
                    </tr>
                    <tr>
                        <td>
                            <table ID="Table3" border="0" cellpadding="1" cellspacing="1" class="module"
                                width="250">
                                <tr>
                                    <td>
                                    </td>
                                    <td>
                                    </td>
                                </tr>
                                <tr>
                                    <td>
                                        SpecialityID:
                                    </td>
                                    <td>
                                        <asp:TextBox ID="txtSpId" runat="server" Font-Names="verdana"   Text='<%# Bind("SPECIALITY_ID") %>'
                                            Font-Size="8.5pt" MaxLength="50" TabIndex="1" ReadOnly="true">
                                                </asp:TextBox>
                                    </td>
                                </tr>
                                <tr>
                                    <td>
                                        Description:
                                    </td>
                                    <td>
                                        <asp:TextBox ID="txtSpDesc" runat="server" Font-Names="verdana"
                                            Font-Size="8.5pt" MaxLength="50" onkeypress=" return CharOnly('txtSpDesc',50)" TabIndex="2"
                                            Text='<%# Bind("SPECIALITY_DESC") %>' >
                                                </asp:TextBox>
                                                 
                                                <asp:RequiredFieldValidator ID="RFVSpDesc" runat="server" ErrorMessage="Enter Description."
                                                                ControlToValidate="txtSpDesc"></asp:RequiredFieldValidator>
                                    </td>
                                </tr>
                            </table>
                        </td>
                    </tr>
                    <tr>
                        <td align="right" colspan="2">
                            <asp:Button ID="btnUpdate3" Text='<%# IIf((TypeOf(Container) is GridEditFormInsertItem), "Insert", "Update") %>'
                                        Style="color: White; background-color: SteelBlue; font-family: Verdana; font-size: 8pt;
                                        width: 87px;" runat="server" CommandName='<%# IIf((TypeOf(Container) is GridEditFormInsertItem), "PerformInsert", "Update")%>'>
                                    </asp:Button>
                              
                            <asp:Button ID="btnCancel3" runat="server" CausesValidation="False"
                                CommandName="Cancel" Style="color: White; background-color: SteelBlue; font-family: Verdana;
                                        font-size: 8pt; width: 87px;" Text="Cancel" />
                        </td>
                    </tr>
                </table>
            </FormTemplate>
        </EditFormSettings>
    </MasterTableView>
</telerik:RadGrid>
function valid() {
var grid = $find("<%=RadGridCountry.ClientID %>");
var detail= grid.get_detailTables()[0].get_dataItems()[0].findElement("txtSpDesc");
 
}
i trace that detail value it giving always null value
Madhuri
Top achievements
Rank 1
 answered on 29 Feb 2012
1 answer
124 views
After session expired when the user click on any Export icon of the grid. it doesnt fire the session expire event.

We have placed the grid inside a radwindow.Following is the code snippet for the grid.
 <telerik:RadGrid ID="rgdDisplay" runat="server" AllowPaging="true" PageSize="5" GridLines="Both"
                                    AutoGenerateColumns="true" EnableEmbeddedSkins="false"   OnColumnCreated="rgdDisplay_ColumnCreated"
                                    EnableViewState="True" OnNeedDataSource="rgdDisplay_NeedDataSource" CellPadding="0"
                                    AllowMultiRowSelection="true" OnItemDataBound="rgdDisplay_ItemDataBound" OnItemCommand="rgdDisplay_ItemCommand"
                                    HeaderStyle-HorizontalAlign="Left" OnItemCreated="rgdDisplay_ItemCreated">
                                    <ExportSettings HideStructureColumns="false" IgnorePaging="true" ExportOnlyData="true"
                                        FileName="Result" OpenInNewWindow="true">
                                        <Pdf PageHeight="210mm" PageWidth="297mm" PageTitle="Advance Search Result" DefaultFontFamily="Arial Unicode MS"
                                            PageBottomMargin="20mm" PageTopMargin="20mm" PageLeftMargin="20mm" PageRightMargin="20mm" />
                                    </ExportSettings>
                                    <MasterTableView DataKeyNames="PatientId" ClientDataKeyNames="PatientId" EnableColumnsViewState="False"
                                        CommandItemDisplay="Top">
                                        <Columns>
                                            <telerik:GridClientSelectColumn UniqueName="ClientSelectColumn" ItemStyle-Width="2%" />
                                        </Columns>
                                        <CommandItemSettings ShowExportToWordButton="true" ShowExportToExcelButton="true"
                                            ShowExportToCsvButton="true" ShowExportToPdfButton="true" ShowRefreshButton="false"
                                            ShowAddNewRecordButton="false" />
                                    </MasterTableView>
                                    <ClientSettings>
                                        <Selecting AllowRowSelect="true" UseClientSelectColumnOnly="true" EnableDragToSelectRows="false" />
                                        <ClientEvents OnRowSelecting="RowSelecting" OnRowDeselected="RowDeselected" />
                                    </ClientSettings>
                                    <HeaderContextMenu  EnableEmbeddedSkins="False">
                                    </HeaderContextMenu>
                                </telerik:RadGrid>

We tried using PAGE METHODS, it worked in IE .
but its causing problem in chrome and Firefox.

Kindly let me knw if more information is needed from my end.

Thnks in advance.


Daniel
Telerik team
 answered on 29 Feb 2012
1 answer
90 views
My requirement is such that I want to have a functionality of  Column Menu  but without having title 'Column' .
As you can see in this link It has a liitle button in shipCity Column.I want to have that Button and when I click that button it will just show me the column names that I want to hide/show. So basically it is a functionality of "Column Menu" but rather then showing in a subMenu manner ,I want to show those Columns of the Grid to be hide/show directly in menu. 

http://demos.telerik.com/aspnet-ajax/grid/examples/generalfeatures/headercontextfiltermenu/defaultcs.aspx
Antonio Stoilkov
Telerik team
 answered on 29 Feb 2012
1 answer
127 views
Hi;

I have a problem with a DataPager paging a RadListView. The RadDataPagerButtonField works as expected when page is loaded the first time; one click and the list pages. After the first pageing is not one click enough, you have to click twice (not double click). I have also noticed that changing page size in the RadDataPagerPageSizeField control has the same effect as the initial click on the RadDataPagerButtonField. Seems like something happens with DataPager after the first paging. Any ideas?



<AjaxSettings>
            <telerik:AjaxSetting AjaxControlID="uxRadPager">
                <UpdatedControls>
                    <telerik:AjaxUpdatedControl ControlID="uxPhotos" LoadingPanelID="uxAjaxLoadingPanel" />
                </UpdatedControls>
            </telerik:AjaxSetting>
        </AjaxSettings>
        <AjaxSettings>
            <telerik:AjaxSetting AjaxControlID="uxPhotos">
                <UpdatedControls>
                    <telerik:AjaxUpdatedControl ControlID="uxRadPager" LoadingPanelID="uxAjaxLoadingPanel" />
                </UpdatedControls>
            </telerik:AjaxSetting>
        </AjaxSettings>

<telerik:RadListView runat="server" ID="uxPhotos" AllowPaging="true" OnNeedDataSource="uxPhotos_NeedDataSource"
                                    OnItemDataBound="uxPhotos_ItemDataBound" ViewStateMode="Enabled">
                                    <LayoutTemplate>
                                        <asp:Table ID="Table3" runat="server" CellPadding="0" CellSpacing="0">
                                            <asp:TableRow>
                                                <asp:TableCell>
                                                    <fieldset runat="server" id="itemPlaceholder" />
                                                </asp:TableCell>
                                            </asp:TableRow>
                                        </asp:Table>
                                        <telerik:RadDataPager ID="uxRadPager" Skin="Vista" runat="server" PagedControlID="uxPhotos"
                                            PageSize="10" ViewStateMode="Enabled">
                                            <Fields>
                                                <telerik:RadDataPagerButtonField FieldType="FirstPrev" />
                                                <telerik:RadDataPagerButtonField FieldType="Numeric" />
                                                <telerik:RadDataPagerButtonField FieldType="NextLast" />
                                                <telerik:RadDataPagerPageSizeField PageSizeText="Page size: " />
                                                <telerik:RadDataPagerGoToPageField CurrentPageText="Page: " TotalPageText="of" SubmitButtonText="Go"
                                                    TextBoxWidth="15" />
                                            </Fields>
                                        </telerik:RadDataPager>
                                    </LayoutTemplate>
                                    <ItemTemplate>
                                        <fieldset style="float: left; margin: 0px 0px 0px 0px; padding: 0px 0px 0px 0px;
                                            vertical-align: middle; text-align: center; width: 90px; border: 0px;">
                                            <asp:Table runat="server" CellPadding="0" CellSpacing="0">
                                                <asp:TableRow>
                                                    <asp:TableCell Style="position: relative">
                                                        <div style="position: relative">
                                                            <asp:Image runat="server" ImageUrl="~/Images/ThumbnailBg.jpg" />
                                                            <div id="Div1" runat="server" style="position: absolute; left: 10px; top: 10px; z-index: 1;">
                                                                <asp:HyperLink runat="server" ID="uxPhotoLink">
                                                                    <asp:Image runat="server" ID="uxPhoto" /></asp:HyperLink>
                                                                <div id="Div2" runat="server" style="position: absolute; left: 62px; top: -10px;
                                                                    z-index: 2; height: 20px; width: 20px">
                                                                    <asp:Image runat="server" ID="uxStatus" ImageUrl="~/Images/StatusEdit.png" />
                                                                </div>
                                                            </div>
                                                        </div>
                                                    </asp:TableCell>
                                                </asp:TableRow>
                                            </asp:Table>
                                        </fieldset>
                                    </ItemTemplate>
                                </telerik:RadListView>
Antonio Stoilkov
Telerik team
 answered on 29 Feb 2012
1 answer
92 views

Hi,

I am having a combobox like this,

 

<telerik:RadComboBox ID="txtDoctorId" runat="server" AutoPostBack="true" AllowCustomText="true"

 ExpandAnimation-Type="Linear" CollapseAnimation-Type="Linear" Width="300px" EnableLoadOnDemand="true"

 Filter="Contains">

 <HeaderTemplate>

 <table>

 <tr>  

<td style="width: 80px;">

 Code

</td>

 <td style="width: 220px;">

 Consultant Name

 </td>

 </tr>

 </table>

 </HeaderTemplate>

 <ItemTemplate>

 <table>

 <tr id="cmbRow">

 <td id="cellCode" style="width: 80px">

 </td>

 <td id="cellName" style="width: 220px">

  </td>

 </tr>

 </table>

 </ItemTemplate>

 </telerik:RadComboBox>

 I have to find the htmltablecell inside the itemtemplate during itemdatabound

plz help me..Thnx in advance....

Princy
Top achievements
Rank 2
 answered on 29 Feb 2012
1 answer
80 views
Hi all,

I have an aspx page with a windowmanager which contains 2 separate windows (window1 and window2). Window 2 is a lookup dialogue form containing values which the user can select to return values to the parent window. Both Windows can be opened directly from the aspx page.

Window2 can also be opened from Window1. Originally I put a new windowmanager in Window1 but I realised that this was not correct because when window2 was opened from window1, it opened inside window1 (and was only partially visible and restricted to window 1's borders) which is not correct. So as per the documentation (http://www.telerik.com/help/aspnet-ajax/window-programming-opening-from-within-dialog.html) I use the aspx forms window manager to open window2 from window1.

My problem is that I am using the onClientClose event for window2 to populate the aspx page with return values from window2. However I also need to populate window1 with return values from window2 when window2 is called from window1.

Does anybody know how I can (and should) achieve this?

Many Thanks

Mark
Marin Bratanov
Telerik team
 answered on 29 Feb 2012
1 answer
86 views
I am not sure this should actually be here in Grid or Ajax manager. I have a Grid and an Ajax manager control. I insert into the grid and, as expected, the whole page does not refresh yet the grid does. (Very Nice).

Now I have run into an issue where I have had to add a SQLDataSource and FormView on the page that needs to be updated after the insert into the Grid. I can force the page to refresh and have the FormView update but this sort of defeats the purpose of using the Ajax control to prevent a full page refresh.

I have tried to have the SQLDataSource and FormView refresh using both the Gridss ItemInserted and/or the Grid's SQLDataSource Inserted to force a rebind of the FormView. Niether worked.

Is there a way to have the FormView rebind/refresh after the Grid Insert has occured?

Here is my AJAX code:

<telerik:RadCodeBlock ID="RadCodeBlock1" runat="server">
    <script type="text/javascript" language="javascript">
        function refreshGrid(arg) {
            if (!arg) {
                $find("<%= RadAjaxManager1.ClientID %>").ajaxRequest("Rebind");
            }
        }
    </script>
</telerik:RadCodeBlock>


<telerik:RadAjaxManager ID="RadAjaxManager1" runat="server">
    <AjaxSettings>
         <telerik:AjaxSetting AjaxControlID="RadCodeBlock1">
             <UpdatedControls>
                 <telerik:AjaxUpdatedControl ControlID="rgd_Labor" UpdatePanelHeight="" />
                 <telerik:AjaxUpdatedControl ControlID="rgd_Materials" UpdatePanelHeight="" />
             </UpdatedControls>
        </telerik:AjaxSetting>
    </AjaxSettings>
    </telerik:RadAjaxManager>







Jayesh Goyani
Top achievements
Rank 2
 answered on 29 Feb 2012
3 answers
118 views
Hi.
I have a RadDateTimePicker in a grid.How i can compare SelectedDate(DateTime type!)  with today's date?
My code:
protected void RadGrid1_ItemCreated(object sender, GridItemEventArgs e)
    {
        if (e.Item is GridEditableItem && e.Item.IsInEditMode)
        {
            GridEditableItem item = e.Item as GridEditableItem;
            RadDateTimePicker startDate = (RadDateTimePicker)item.FindControl("startDate");
 
            TableCell cell = (TableCell)start.Parent;
 
            CompareValidator CV1 = new CompareValidator();
            CV1.ErrorMessage = "*";
            CV1.ControlToValidate = startDate.ID;
            CV1.Operator = ValidationCompareOperator.GreaterThanEqual;
            CV1.ValueToCompare = DateTime.Now.ToString();
            cell.Controls.Add(CV1);
 
            }
      }
Please help,
Thanks.
xvikx
Top achievements
Rank 1
 answered on 29 Feb 2012
1 answer
169 views
I want to find the Setup Offline of RadControls For AspNet Ajax (Free Trial Q1 2012). Can you help me - show for me link download RadControls for aspnet ajax setup offline free trial Q1 2012?
Princy
Top achievements
Rank 2
 answered on 29 Feb 2012
2 answers
246 views
Hi,
     Am using Footer in Rad Grid for summing up my total column.
Now the total is showing for the entire datasource which i set for that grid.
All i needed is to display the summation , for the current page records alone (say for the current 10 records if i set to pagesize as 10).
Is there any way to implement this feature ?



Regards,
Karthikeyan G
Karthi Keyan
Top achievements
Rank 1
 answered on 29 Feb 2012
Narrow your results
Selected tags
Tags
+? more
Top users last month
Jay
Top achievements
Rank 3
Iron
Iron
Iron
yw
Top achievements
Rank 2
Iron
Iron
Stefan
Top achievements
Rank 2
Iron
Iron
Iron
Kao Hung
Top achievements
Rank 1
Iron
Bohdan
Top achievements
Rank 2
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Jay
Top achievements
Rank 3
Iron
Iron
Iron
yw
Top achievements
Rank 2
Iron
Iron
Stefan
Top achievements
Rank 2
Iron
Iron
Iron
Kao Hung
Top achievements
Rank 1
Iron
Bohdan
Top achievements
Rank 2
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?