Telerik Forums
UI for ASP.NET AJAX Forum
0 answers
107 views

I want to call a storedprocedure when filtering happens in RadGrid , but it does not seem to be working. How do I override the default filering and bind to the data from the storedprocedure?

protected void RadGridMaster_ItemCommand(object source, GridCommandEventArgs e)
 {
     if (e.CommandName == RadGrid.FilterCommandName)
     {
         Pair filterPair = (Pair)e.CommandArgument;
         string filterPattern = ((TextBox)(e.Item as GridFilteringItem)[filterPair.Second.ToString()].Controls[0]).Text;
 
         //string filter = RadGridMaster.MasterTableView.FilterExpression;
         BindMasterGrid(filterPattern);
         (this.Page as BasePage).ClearAllControls();
     }
 }

Prashanthi
Top achievements
Rank 1
 asked on 26 Mar 2012
3 answers
832 views
Hello,

I added TemplateColumns to my RadGrid and now my grid is way too big: 2209px wide within a ~900px div (see attached 1, FireBug shows width as 2209px (circled)). The content of the grid is easily small enough to fit (see attached 2 (manually changed the width in FireBug)). When the grid is empty, the sizing is fine (see attached 3). Is this a bug with template columns that's causing the total grid Width to be wrong, or am I missing something?

I tried setting each TemplateColumn's ItemStyle-Width property individually, but got the same result. Changing the RadGrid's Width property has no effect. Below is my Grid Code.

<tel:RadGrid runat="server" ID="rgImportData" AutoGenerateColumns="false" Width="100%" >
    <MasterTableView>
        <Columns>
            <tel:GridTemplateColumn HeaderText="Exclude from Import" UniqueName="ExcludeColumn" >
                <ItemTemplate>
                    <asp:CheckBox ID="cbExcludeFromImport" runat="server" />
                </ItemTemplate>
            </tel:GridTemplateColumn>
            <tel:GridBoundColumn DataField="SpeciesName" HeaderText="Species Name" UniqueName="SpeciesName" />
            <tel:GridBoundColumn DataField="SpeciesID" UniqueName="SpeciesID" Display="false" />
            <tel:GridTemplateColumn HeaderText="Length" UniqueName="Length" >
                <ItemTemplate>
                    <tel:RadNumericTextBox runat="server" ID="rgrntLength" Text='<%# Eval("Length") %>' NumberFormat-DecimalDigits="0" Width="40px" MaxValue="9999" />
                </ItemTemplate>
            </tel:GridTemplateColumn>
            <tel:GridTemplateColumn HeaderText="Weight" UniqueName="Weight" >
                <ItemTemplate>
                    <tel:RadNumericTextBox runat="server" ID="rgrntWeight" Text='<%# Eval("Weight") %>' NumberFormat-DecimalDigits="0" Width="40px" MaxValue="9999" />
                </ItemTemplate>
            </tel:GridTemplateColumn>
            <tel:GridBoundColumn DataField="Sex" HeaderText="Sex" UniqueName="Sex" />
            <tel:GridTemplateColumn HeaderText="Age" UniqueName="Age" >
                <ItemTemplate>
                    <tel:RadNumericTextBox runat="server" ID="rgrntAge" Text='<%# Eval("Age") %>' NumberFormat-DecimalDigits="0" Width="40px" MaxValue="9999" />
                </ItemTemplate>
            </tel:GridTemplateColumn>
            <tel:GridTemplateColumn HeaderText="Magn." UniqueName="Magnification" >
                <ItemTemplate>
                    <tel:RadNumericTextBox runat="server" ID="rgrntMagnification" Text='<%# Eval("Magnification") %>' NumberFormat-DecimalDigits="0" Width="40px" MaxValue="9999" />
                </ItemTemplate>
            </tel:GridTemplateColumn>
            <tel:GridTemplateColumn HeaderText="Annulus 1" UniqueName="Annulus1" >
                <ItemTemplate>
                    <tel:RadNumericTextBox runat="server" ID="rgrntAnn1" Text='<%# Eval("Annulus1") %>' NumberFormat-DecimalDigits="0" Width="40px" MaxValue="9999" />
                </ItemTemplate>
            </tel:GridTemplateColumn>
            <tel:GridTemplateColumn HeaderText="Annulus 2" UniqueName="Annulus2" >
                <ItemTemplate>
                    <tel:RadNumericTextBox runat="server" ID="rgrntAnn2" Text='<%# Eval("Annulus2") %>' NumberFormat-DecimalDigits="0" Width="40px" MaxValue="9999" />
                </ItemTemplate>
            </tel:GridTemplateColumn>
            <tel:GridTemplateColumn HeaderText="Annulus 3" UniqueName="Annulus3" >
                <ItemTemplate>
                    <tel:RadNumericTextBox runat="server" ID="rgrntAnn3" Text='<%# Eval("Annulus3") %>' NumberFormat-DecimalDigits="0" Width="40px" MaxValue="9999" />
                </ItemTemplate>
            </tel:GridTemplateColumn>
            <tel:GridTemplateColumn HeaderText="Annulus 4" UniqueName="Annulus4" >
                <ItemTemplate>
                    <tel:RadNumericTextBox runat="server" ID="rgrntAnn4" Text='<%# Eval("Annulus4") %>' NumberFormat-DecimalDigits="0" Width="40px" MaxValue="9999" />
                </ItemTemplate>
            </tel:GridTemplateColumn>
            <tel:GridTemplateColumn HeaderText="Annulus 5" UniqueName="Annulus5" >
                <ItemTemplate>
                    <tel:RadNumericTextBox runat="server" ID="rgrntAnn5" Text='<%# Eval("Annulus5") %>' NumberFormat-DecimalDigits="0" Width="40px" MaxValue="9999" />
                </ItemTemplate>
            </tel:GridTemplateColumn>
            <tel:GridTemplateColumn HeaderText="Annulus 6" UniqueName="Annulus6" >
                <ItemTemplate>
                    <tel:RadNumericTextBox runat="server" ID="rgrntAnn6" Text='<%# Eval("Annulus6") %>' NumberFormat-DecimalDigits="0" Width="40px" MaxValue="9999" />
                </ItemTemplate>
            </tel:GridTemplateColumn>
            <tel:GridTemplateColumn HeaderText="Annulus 7" UniqueName="Annulus7" >
                <ItemTemplate>
                    <tel:RadNumericTextBox runat="server" ID="rgrntAnn7" Text='<%# Eval("Annulus7") %>' NumberFormat-DecimalDigits="0" Width="40px" MaxValue="9999" />
                </ItemTemplate>
            </tel:GridTemplateColumn>
            <tel:GridTemplateColumn HeaderText="Annulus 8" UniqueName="Annulus8" >
                <ItemTemplate>
                    <tel:RadNumericTextBox runat="server" ID="rgrntAnn8" Text='<%# Eval("Annulus8") %>' NumberFormat-DecimalDigits="0" Width="40px" MaxValue="9999" />
                </ItemTemplate>
            </tel:GridTemplateColumn>
            <tel:GridTemplateColumn HeaderText="Edge" UniqueName="Edge" >
                <ItemTemplate>
                    <tel:RadNumericTextBox runat="server" ID="rgrntEdge" Text='<%# Eval("Edge") %>' NumberFormat-DecimalDigits="0" Width="40px" MaxValue="9999" />
                </ItemTemplate>
            </tel:GridTemplateColumn>
        </Columns>
        <NoRecordsTemplate>
            Select a file to see what data will be imported into this view.
        </NoRecordsTemplate>
    </MasterTableView>
</tel:RadGrid>
Richard
Top achievements
Rank 1
 answered on 26 Mar 2012
1 answer
128 views
Hi All

how I can edit a specific cell of a gridview selecting a row in javascript ?.


Thank you very much beforehand.

Richard
Top achievements
Rank 1
 answered on 26 Mar 2012
1 answer
59 views
Hi,
if we are having a telerik ajax panel inside another radajax panel then if there is any postback in the controls inside the inner radajax panel then which ajax panel will work?
is there any benefit of using radajax panel inside another radajax panel?

Thanks in advance
Jiju
Eyup
Telerik team
 answered on 26 Mar 2012
7 answers
386 views
Hi,

Is there a way to add the CalendarExtender from Ajax Control Toolkit inside the RadGrid ? In my table I've got a datetime field so I need to perform a little validation for the date field.

Thanks a lot
Martin
Telerik team
 answered on 26 Mar 2012
3 answers
65 views
Hi Team,
I am using Editor, i passed the data from DB to editor is like
<table class="topbot" pgwide="1" id="nzf_734"><caption>
              Recommended regimens for
              <i>Helicobacter pylori</i>
              eradication in adults
            </caption><colgroup cols="5"><col colname="col1" /><col colname="col2" /><col colname="col3" /><col colname="col4" /><col colname="col5" /></colgroup>
<colspec colname="col1" />
<colspec colname="col2" />
<colspec colname="col3" />
<colspec colname="col4" />
<colspec colname="col5" /><thead> etc 
But the editor display the above content as like
<table id="nzf_734" class="topbot" pgwide="1"><caption>
              Recommended regimens for
              <i>Helicobacter pylori</i>
              eradication in adults
            </caption>
<colgroup cols="5"><col colname="col1">
<col colname="col2"><col colname="col3">
<col colname="col4"><col colname="col5">
</colgroup><colspec colname="col1"><colspec colname="col2"><colspec colname="col3"><colspec colname="col4"><colspec colname="col5"><thead>                                                                                                                                                                                                                                                                                                                                                                                                                                                                             

                Editor automatically remove the end tag, if it is not contain the value.
it will create problem for me. How to solve this issue. Please help me. It is urgent.

Thanks
Uma
Rumen
Telerik team
 answered on 26 Mar 2012
28 answers
801 views
Hi

I have GridDropdownColumn in RadGrid with different source. I wired the DataField, ListValueField and ListTextField all correctly. It doesn't show the value properly when the grid is shown but when edit mode you select the dropdown value it stores is correctly. When displaying in grid, it all shows "&nbsp;"  am I missing anything?

Attached the code.

 <telerik:RadAjaxPanel ID="RadAjaxPanel1" runat="server">
        <telerik:RadGrid ID="RadGrid1" runat="server" AllowSorting="true" AllowPaging="true"
            PageSize="25" ShowStatusBar="true" AllowAutomaticInserts="True" AllowAutomaticUpdates="True"
            AllowAutomaticDeletes="True" DataSourceID="PetroSqlDataSource">
            <MasterTableView EditMode="Popup" CommandItemDisplay="Bottom" DataSourceID="PetroSqlDataSource"
                DataKeyNames="Id" AutoGenerateColumns="false">
                <Columns>
                    <telerik:GridEditCommandColumn />
                    <telerik:GridButtonColumn CommandName="Delete" Text="Delete" UniqueName="DeleteColumn" />
                    <telerik:GridBoundColumn DataField="Id" HeaderText="Unique ID" ReadOnly="True" UniqueName="UniqueID"
                        Display="false" />
                    <telerik:GridBoundColumn DataField="SkillId" HeaderText="Skill ID" UniqueName="SkillID" />
                    <telerik:GridDropDownColumn UniqueName="DropDownListColumn" ListTextField="Discipline"
                        ListValueField="Discipline" DataSourceID="PetroSqlDataSource2" HeaderText="Discipline"
                        DataField="Discipline" DropDownControlType="RadComboBox" AllowSorting="true" Display="false">
                    </telerik:GridDropDownColumn>
                    <telerik:GridBoundColumn DataField="Discipline" HeaderText="Discipline" UniqueName="Discipline"
                        ReadOnly="True" />
                    <telerik:GridBoundColumn DataField="Skill" HeaderText="Skill" UniqueName="Skill" />
                    <telerik:GridBoundColumn DataField="Description" HeaderText="Description" UniqueName="Description" />
                    <telerik:GridBoundColumn DataField="Foundation" HeaderText="Foundation" UniqueName="Foundation" />
                    <telerik:GridBoundColumn DataField="SkillType" HeaderText="SkillType" UniqueName="SkillType" />
                </Columns>
            </MasterTableView>
        </telerik:RadGrid>
        <asp:SqlDataSource ID="PetroSqlDataSource" ConnectionString="<%$ConnectionStrings:PetroTechConnectionString%>"
            runat="server" SelectCommand="SELECT [Id],[SkillId], [Discipline],[Skill],[Description], [Foundation],[SkillType] FROM [Skills]"
            InsertCommand="INSERT INTO [Skills] ([SkillId],[Discipline],[Skill],[Description],[Foundation],[SkillType]) VALUES (@SkillId,@Discipline,@Skill,@Description,@Foundation,@SkillType)"
            UpdateCommand="UPDATE [Skills] SET [SkillId] = @SkillId,[Skill] = @Skill, [Description] = @Description, [Foundation] = @Foundation, [SkillType] = @SkillType WHERE [ID] = @ID"
            DeleteCommand="DELETE FROM [Skills] WHERE [Id] = @ID">
            <InsertParameters>
                <asp:Parameter Name="SkillId" Type="String" Size="10" />
                <asp:Parameter Name="Discipline" Type="String" Size="50" />
                <asp:Parameter Name="Skill" Type="String" Size="50" />
                <asp:Parameter Name="Description" Type="String" />
                <asp:Parameter Name="Foundation" Type="Int32" />
                <asp:Parameter Name="SkillType" Type="Int32" />
            </InsertParameters>
        </asp:SqlDataSource>


        <asp:SqlDataSource ID="PetroSqlDataSource2" ConnectionString="<%$ConnectionStrings:PetroTechConnectionString%>"
            runat="server" SelectCommand="SELECT [Id],[Discipline] FROM [Disciplines]">
            </asp:SqlDataSource>
Mike
Top achievements
Rank 2
 answered on 26 Mar 2012
2 answers
519 views
How do I set columns to HtmlEncode="false" when I am setting AutoGenerateColumns="true" for the RadGrid?
Scott
Top achievements
Rank 1
 answered on 26 Mar 2012
4 answers
86 views
I ran across a java script function called raise_passwordStrengthCalculating but I can't find any documentaion on it or how to use it?  See I've figured out a way how to get a value from a database into a password field, but I haven't figured out how to get the password field to calculate the password strength.  And I think that function would do it, but can't quite wrap my head around how to call it.

I guess I didn't get my secret decoder ring along with my subscription.
SSirica
Top achievements
Rank 3
Iron
Iron
Iron
 answered on 26 Mar 2012
2 answers
245 views
I would like to expand only 1 row based on data that is found during the ItemDataBound event.  Is this possible?
Seth
Top achievements
Rank 1
 answered on 26 Mar 2012
Narrow your results
Selected tags
Tags
+? more
Top users last month
Jay
Top achievements
Rank 3
Iron
Iron
Iron
Benjamin
Top achievements
Rank 3
Bronze
Iron
Veteran
Radek
Top achievements
Rank 2
Iron
Iron
Iron
Bohdan
Top achievements
Rank 2
Iron
Iron
Richard
Top achievements
Rank 4
Bronze
Bronze
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Jay
Top achievements
Rank 3
Iron
Iron
Iron
Benjamin
Top achievements
Rank 3
Bronze
Iron
Veteran
Radek
Top achievements
Rank 2
Iron
Iron
Iron
Bohdan
Top achievements
Rank 2
Iron
Iron
Richard
Top achievements
Rank 4
Bronze
Bronze
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?