Telerik Forums
UI for ASP.NET AJAX Forum
3 answers
1.3K+ views
Hi I am binding a radgrid and column width is adjusted by a cssclass as shown below in code, But issue is, this css works on column data but not on hearders... i am reffering to latest telerik dll.

<style type="text/css">
    .AutoShrink {
        width: auto !important;
    }
</style>
<telerik:RadGrid ID="rgWorkInProgress" runat="server" AllowPaging="True" AllowSorting="True" ShowStatusBar="True"
    AutoGenerateColumns="False" PageSize="10" ShowGroupPanel="False" AllowFilteringByColumn="true"
    CellSpacing="0" GridLines="None" EnableTheming="true" AllowCustomPaging="true"
    OnNeedDataSource="rgWorkInProgress_NeedDataSource" OnPageIndexChanged="rgWorkInProgress_PageIndexChanged"
    OnSortCommand="rgWorkInProgress_SortCommand" HeaderStyle-CssClass="AutoShrink">

    <PagerStyle Mode="NextPrevAndNumeric" AlwaysVisible="true" />

    <ClientSettings AllowDragToGroup="false">
        <Resizing AllowColumnResize="true" AllowResizeToFit="true" />
        <Scrolling AllowScroll="True" UseStaticHeaders="true" SaveScrollPosition="true" />
        <ClientEvents OnFilterMenuShowing="filterMenuShowing" />
    </ClientSettings>

    <MasterTableView TableLayout="Auto" AllowCustomSorting="true" AllowNaturalSort="false" AllowFilteringByColumn="True" CssClass="AutoShrink">

        <EditFormSettings>
            <EditColumn />
        </EditFormSettings>

        <HeaderStyle HorizontalAlign="Left" Wrap="false" CssClass="AutoShrink"/>
        <FilterItemStyle HorizontalAlign="Left" Wrap="false" />
        <ItemStyle HorizontalAlign="Left" VerticalAlign="Top" Wrap="false" />
Eyup
Telerik team
 answered on 25 Sep 2013
2 answers
136 views
Hi,
i am having rad grid in which i used EditMode and i want to do validations using radwindow like
1 ] when i click delete ,it must ask for confirmation and for yes delete code execute
2 ] when i click update ,it must ask for confirmation and for yes update code execute
3 ]On insert button click it will show success alert for data insertion

My aspx code
<telerik:RadWindowManager ID="RadWindowManager1" runat="server" EnableShadow="true">
   </telerik:RadWindowManager>
   <telerik:RadWindow ID="radwindowPopup" runat="server" Animation="FlyIn" CssClass="modalPopup"
       DestroyOnClose="true" EnableShadow="true" KeepInScreenBounds="true" Width="420px"
       Height="150px" MaxHeight="150px" MaxWidth="420px" MinHeight="150px" MinWidth="420px"
       Modal="true" RenderMode="Classic" VisibleTitlebar="true" VisibleStatusbar="false"
       Behaviors="Close" Title="Manifest-BI" Skin="Outlook">
       <ContentTemplate>
           <center>
               <div style="padding: 20px">
                   <asp:Label ID="lblMsg" runat="server"></asp:Label>
                   <br />
                   <br />
                   <telerik:RadButton ID="btnOk" runat="server" Text="Yes" Width="70px" Skin="Outlook" />
                   <telerik:RadButton ID="btnCancel" runat="server" Text="No" Width="70px" Skin="Outlook" />
               </div>
           </center>
       </ContentTemplate>
   </telerik:RadWindow>
   <fieldset id="fs1" runat="server" style="height: auto; width: 650PX; border-style: outset;
       border-width: 1.5px; border-color: Blue; z-index: 1" class="loginField">
       <legend style="border-style: outset; border-width: 1.5px; border-color: Blue; font-weight: bold;
           z-index: 1">COMPANY LIST</legend>
       <center>
           <table>
               <tr>
                   <td>
                       <telerik:RadAjaxPanel ID="RadAjaxPanel1" runat="server" ClientEvents-OnRequestStart="onRequestStart">
                           <%-- EnableViewState="False" --%>
                           <telerik:RadGrid ID="RadGrid1" runat="server" Width="530px" OnNeedDataSource="RadGrid1_NeedDataSource"
                               AllowPaging="true" PageSize="10" AllowSorting="true" ShowGroupPanel="True" Skin="WebBlue"
                               OnDeleteCommand="RadGrid1_DeleteCommand" HeaderStyle-Font-Bold="true" OnPreRender="RadGrid1_PreRender"
                               OnUpdateCommand="RadGrid1_UpdateCommand" OnItemCreated="RadGrid1_ItemCreated"
                               OnInsertCommand="RadGrid1_InsertCommand" OnItemCommand="RadGrid1_ItemCommand">
                               <ExportSettings ExportOnlyData="true" OpenInNewWindow="true" IgnorePaging="true">
                                   <Pdf AllowAdd="true" AllowCopy="true" AllowModify="true" AllowPrinting="true" BorderColor="Black"
                                       BorderStyle="Medium" BorderType="AllBorders" PageBottomMargin="20px" PageFooter-LeftCell-TextAlign="Center"
                                       PageFooterMargin="20px" PageHeader-LeftCell-TextAlign="Center" PageHeaderMargin="20px"
                                       PageLeftMargin="35px" PageRightMargin="35px" PageTitle="List Of Companies and Details"
                                       PageTopMargin="35px" PaperSize="A4" UserPassword="ss">
                                   </Pdf>
                               </ExportSettings>
                               <PagerStyle Mode="NextPrevAndNumeric" AlwaysVisible="true"></PagerStyle>
                               <ClientSettings Selecting-AllowRowSelect="true" AllowDragToGroup="True" EnablePostBackOnRowClick="true">
                                   <Selecting AllowRowSelect="True" UseClientSelectColumnOnly="True"></Selecting>
                               </ClientSettings>
                               <MasterTableView EditMode="EditForms" AutoGenerateColumns="true" DataKeyNames="CompId"
                                   CommandItemDisplay="Top" CommandItemSettings-ShowAddNewRecordButton="true">
                                   <CommandItemSettings ShowExportToPdfButton="true" />
                                   <CommandItemSettings ShowExportToExcelButton="true" />
                                   <CommandItemSettings ShowExportToWordButton="true" />
                                   <CommandItemSettings ShowExportToCsvButton="true" />
                                   <EditFormSettings FormMainTableStyle-HorizontalAlign="Center" EditColumn-ButtonType="ImageButton"
                                       FormTableStyle-Width="350px" FormTableButtonRowStyle-HorizontalAlign="Center"
                                       FormTableStyle-CellPadding="3" FormMainTableStyle-Font-Bold="true" FormMainTableStyle-ForeColor="Purple"
                                       FormStyle-CssClass="" FormTableStyle-CellSpacing="5" InsertCaption="Add New Record"
                                       FormCaptionStyle-Font-Bold="true" FormCaptionStyle-Font-Underline="true" FormCaptionStyle-ForeColor="Black"
                                       FormCaptionStyle-Font-Size="Large" FormCaptionStyle-HorizontalAlign="Center"
                                       FormCaptionStyle-Width="100%">
                                       <FormStyle Width="100%" BackColor="LightCyan"></FormStyle>
                                   </EditFormSettings>
                                   <Columns>
                                       <telerik:GridEditCommandColumn ButtonType="ImageButton" UniqueName="EditColumn">
                                       </telerik:GridEditCommandColumn>
                                   </Columns>
                               </MasterTableView>
                               <MasterTableView>
                                   <Columns>
                                       <telerik:GridButtonColumn CommandName="Delete" Text="Delete" UniqueName="DeleteColumn"
                                           ButtonType="ImageButton" />
                                   </Columns>
                               </MasterTableView>
                           </telerik:RadGrid>
                       </telerik:RadAjaxPanel>
                   </td>
               </tr>
           </table>
       </center>
   </fieldset>
Thanks
Eyup
Telerik team
 answered on 25 Sep 2013
16 answers
1.7K+ views
i have a radgrid which allowed for multirowselection = true.  i can select more than one row by check the select column.  All the selected rows will be deselected if i click on any row or record inside the grid.  Is there any way that i can remain all those selected rows.

Eyup
Telerik team
 answered on 25 Sep 2013
1 answer
77 views
I have a RadGrid definition as defined below (column definitions snipped for brevity).

I have an odd issue w/ the "Add New Record" button in the CommandItemDisplay 'disappearing' randomly.

What I mean, simply, is for random people at random periods of time for some inexplicable reason, when the RadGrid is displayed to the user, there will be no "Add New Record" option at the bottom of the grid. Two people side-by-side can be using the app, one will get the button, the other won't. Once someone doesn't get the button, it will not immediately come back, but, if they wait long enough and go back into the application, it will mysteriously reappear. Stopping the application pool and restarting it will usually 'clear' up the problem "immediately", but, that has the unfortunate side-effect of knocking everyone else out too.

I've looked through the IIS logs, and I do not see any unusual "errors" (no 4xx or 5xx status codes) associated w/ the user when it does happen. The application is compiled and deployed. Also, for what its worth, I do not recall this problem occurring before the application was precompiled for deploy.

I don't really expect an "answer" to this issue here, since it isn't reproducible at a whim. Instead, I was hoping someone might give me some insight as to where the data for the CommandItemDisplay line originates from (WebResource.axd file?) and maybe, just maybe, someone else has encountered this issue and discovered what they did wrong or had to change within IIS to resolve it. It sure would be helpful since I get at least 6 calls a day about this issue.

FWIW, I'm using the latest version of the controls, ASP.NET AJAX, IIS server running on 2008r2, with a .NET 4.0 application.

                <telerik:RadGrid    ID="RadGrid_Details"
                                    runat="server"
                                    AutoGenerateColumns="False"
                                    DataSourceID="SqlDataSource_Details"
                                    GridLines="None"
                                    AllowAutomaticInserts="True"
                                    AllowAutomaticDeletes="True"
                                    AllowAutomaticUpdates="True"
                                    AllowSorting="True"
                                    onitemcommand="RadGrid_Details_ItemCommand"
                                    OnItemDeleted="RadGrid_Details_ItemDeleted"
                                    OnItemInserted="RadGrid_Details_ItemInserted"
                                    OnItemUpdated="RadGrid_Details_ItemUpdated"
                                    Width="925px"
                                    onitemdatabound="RadGrid_Details_ItemDataBound"
                                    onprerender="RadGrid_Details_PreRender" >
                    <ClientSettings AllowDragToGroup="True">
                    </ClientSettings>
                    <MasterTableView DataSourceID="SqlDataSource_Details"
                                     autogeneratecolumns="False"
                                     commanditemdisplay="Bottom"
                                     editmode="InPlace" ShowFooter="true"
                                     horizontalalign="NotSet" AllowPaging="True" DataKeyNames="Detail_GUID" >
                        <Columns>
(column telerik:control definitions)
                        </Columns>
                        <EditFormSettings>
                            <EditColumn UniqueName="EditCommandColumn1">
                            </EditColumn>
                        </EditFormSettings>
                    </MasterTableView>
                </telerik:RadGrid>
Antonio Stoilkov
Telerik team
 answered on 25 Sep 2013
4 answers
62 views
Hello,
I am trying to follow the tutorial at http://demos.telerik.com/aspnet-ajax/grid/examples/dataediting/threelevel/defaultcs.aspx
Below is the applicable code as to where I think the issue may be. Anyone have any ideas why the grid does not even display any data when I load the page.

<telerik:RadScriptManager ID="RadScriptManager1" runat="server">
</telerik:RadScriptManager>
<telerik:RadAjaxManager ID="RadAjaxManager1" runat="server">
    <AjaxSettings>
        <telerik:AjaxSetting AjaxControlID="RadGridSmears">
            <UpdatedControls>
                <telerik:AjaxUpdatedControl ControlID="RadGridSmears"></telerik:AjaxUpdatedControl>
            </UpdatedControls>
        </telerik:AjaxSetting>
    </AjaxSettings>
</telerik:RadAjaxManager>
 
 
<telerik:RadGrid ID="RadGridSmears" runat="server" CellSpacing="0"
    DataSourceID="SqlDataSourceSmears" ShowStatusBar="True"
    AutoGenerateColumns="False" PageSize="3" AllowSorting="True"
    AllowPaging="True" GridLines="None" AllowAutomaticDeletes="True"
    AllowAutomaticUpdates="True" OnItemUpdated="RadGridSmears_ItemUpdated"
    OnItemDeleted="RadGridSmears_ItemDeleted">
 
    <PagerStyle Mode="NumericPages"></PagerStyle>
    <MasterTableView DataSourceID="SqlDataSourceSmears" DataKeyNames="SampleNo" AllowMultiColumnSorting="True"
        Width="100%" CommandItemDisplay="Top" Name="Smears">
        <DetailTables>
            <telerik:GridTableView DataKeyNames="AnalysisNo"
                DataSourceID="SqlDataSourceAnalysis" Width="100%"
                runat="server" CommandItemDisplay="Top" Name="Analysis">
                <ParentTableRelation>
                    <telerik:GridRelationFields DetailKeyField="SampleNo" MasterKeyField="SampleNo">
                    </telerik:GridRelationFields>
                </ParentTableRelation>
...blah...blah
 
<asp:SqlDataSource ID="SqlDataSourceAnalysis" runat="server" ConnectionString="<%$ ConnectionStrings:XConnectionString %>"
    DeleteCommand="DELETE FROM [Analysis] WHERE [AnalysisNo] = @AnalysisNo AND [AnalysisDateTime]=@AnalysisDateTime"
    SelectCommand="SELECT * FROM [Analysis] WHERE [SampleNo] = @SampleNo" UpdateCommand="UPDATE [Analysis] SET [AnalysisDateTime] = @AnalysisDateTime, [AlphaCPM] = @AlphaCPM, [BetaCPM] = @BetaCPM, [InstrumentIDAlpha] = @InstrumentIDAlpha WHERE [AnalysisNo] = @AnalysisNo">
     <SelectParameters>
        <asp:Parameter Name="SampleNo" Type="String"></asp:Parameter>
    </SelectParameters>
    <DeleteParameters>
        <asp:Parameter Name="AnalysisNo" Type="Int32"></asp:Parameter>
        <asp:Parameter Name="AnalysisDateTime" Type="DateTime"></asp:Parameter>
    </DeleteParameters>
    <UpdateParameters>
        <asp:Parameter Name="AnalysisDateTime" Type="DateTime"></asp:Parameter>
        <asp:Parameter Name="AlphaCPM" Type="Int32"></asp:Parameter>
        <asp:Parameter Name="BetaCPM" Type="Int32"></asp:Parameter>
        <asp:Parameter Name="InstrumentIDAlpha" Type="String"></asp:Parameter>
        <asp:Parameter Name="AnalysisNo" Type="Int32"></asp:Parameter>
    </UpdateParameters>
</asp:SqlDataSource>
<asp:SqlDataSource ID="SqlDataSourceSmears" runat="server" ConnectionString="<%$ ConnectionStrings:XConnectionString %>"
    DeleteCommand="DELETE FROM [Smears] WHERE [SampleNo] = @SampleNo"
    SelectCommand="SELECT * FROM [Smears] WHERE [SampleNo] = @SampleNo" UpdateCommand="UPDATE [Smears] SET [Station] = @Station, [SampleDate] = @SampleDate, [BagNo] = @BagNo WHERE [SampleNo] = @SampleNo">
    <SelectParameters>
        <asp:Parameter Name="SampleNo" Type="String"></asp:Parameter>
    </SelectParameters>
    <DeleteParameters>
        <asp:Parameter Name="SampleNo" Type="String"></asp:Parameter>
    </DeleteParameters>
    <UpdateParameters>
        <asp:Parameter Name="Station" Type="String"></asp:Parameter>
        <asp:Parameter Name="SampleDate" Type="DateTime"></asp:Parameter>
        <asp:Parameter Name="BagNo" Type="Int32"></asp:Parameter>
        <asp:Parameter Name="SampleNo" Type="String"></asp:Parameter>
    </UpdateParameters>
</asp:SqlDataSource>
Princy
Top achievements
Rank 2
 answered on 25 Sep 2013
4 answers
146 views
Hello, I have this code in cs

           var imagePath = Server.MapPath("myPath");
                  System.Drawing.Image image = System.Drawing.Image.FromFile(imagePath);
                  using (var stream = new System.IO.MemoryStream())
                  {
                      image.Save(stream, System.Drawing.Imaging.ImageFormat.Jpeg);
MyRadBinaryImage.Width = 525
                     MyRadBinaryImage.Height = 613;
                     MyRadBinaryImage.DataValue = stream.ToArray();
                  }
 and this in aspx
<telerik:radbinaryimage  id="MyRadBinaryImage" runat="server" alternatetext="BinaryImage"  width="525" height="613" resizemode="Fit"  ClientIDMode="Static"></telerik:radbinaryimage>

now I would like to save a copy of the image on the server, how can I do?
Konstantin Dikov
Telerik team
 answered on 25 Sep 2013
6 answers
370 views
I just noticed the new feature giving us access to your latest internal builds. I think this is a great feature and I'm sure it will reduce your workload of having to make builds available to customers on an individual basis.

I have one suggestion. It would be really useful to get an email notification when a new build is made available. Is there a way you can get a subscription feature implemented for it.

Thanks, Steve
Rumen
Telerik team
 answered on 25 Sep 2013
1 answer
120 views

Hi  Arumugam,

Post the below issue in telerik.

I am using a radgrid with paging. In that next and last page is working but previous and first page buttons are not working.

<telerik:RadGrid ID="rgRole3" runat="server" Skin="Office2007"

        CssClass="rgrole1" onneeddatasource="rgRole3_NeedDataSource"

        AllowPaging="True" PagerStyle-AlwaysVisible="true" CellSpacing="0"

        GridLines="None" AllowSorting="True" AutoGenerateColumns="False" onupdatecommand="rgRole3_UpdateCommand">

<PagerStyle AlwaysVisible="True" PageSizeControlType="RadComboBox" Mode="NextPrevAndNumeric" ></PagerStyle>

 

        <ClientSettings>

            <Scrolling AllowScroll="True" UseStaticHeaders="true"  />

        </ClientSettings>

 

    <MasterTableView>

<CommandItemSettings ExportToPdfText="Export to PDF"></CommandItemSettings>

 

<RowIndicatorColumn FilterControlAltText="Filter RowIndicator column"></RowIndicatorColumn>

 

<ExpandCollapseColumn Visible="True" FilterControlAltText="Filter ExpandColumn column"

            Created="True"></ExpandCollapseColumn>

    <Columns>

    <telerik:GridEditCommandColumn Display="true" HeaderStyle-Width="60px"

            CancelImageUrl="Cancel.gif" InsertImageUrl="Update.gif"

            UpdateImageUrl="Update.gif">

    <HeaderStyle Width="60px"></HeaderStyle>

    </telerik:GridEditCommandColumn>

 

<EditFormSettings>

<EditColumn UniqueName="EditCommandColumn1"

        FilterControlAltText="Filter EditCommandColumn1 column"

        CancelImageUrl="Cancel.gif" InsertImageUrl="Update.gif"

        UpdateImageUrl="Update.gif"></EditColumn>

</EditFormSettings>

 

<PagerStyle AlwaysVisible="True" PageSizeControlType="RadComboBox"></PagerStyle>

    </MasterTableView>

<clientsettings>

<Selecting AllowRowSelect="True" />

<scrolling allowscroll="True" UseStaticHeaders="true"  ScrollHeight="350px" /></clientsettings>

<FilterMenu EnableImageSprites="False"></FilterMenu>

    </telerik:RadGrid>

I have  searched all your demos and forums but I am not able to find the correct solution. Please let us know the correct solution

Thanks

Princy
Top achievements
Rank 2
 answered on 25 Sep 2013
1 answer
310 views
I'm wondering if there is a control like a link (that looks underlined and changes its color). I know the RadButton can be used as ButtonType="LinkButton" but in that case the control doesn't looks like I need.
Shinu
Top achievements
Rank 2
 answered on 25 Sep 2013
1 answer
409 views
Public Function GetDataTable(ByVal query As String) As DataTable
    Dim ConnString As [String] = ConfigurationManager.ConnectionStrings("ConnectionString").ConnectionString
    Dim adapter As New SqlDataAdapter()
    Dim myDataTable As New DataTable()
    Using conn As New SqlConnection(ConnString)
        adapter.SelectCommand = New SqlCommand(query, conn)
        adapter.Fill(myDataTable)
    End Using
    Return myDataTable
End Function

RadGrid1.DataSource = GetDataTable(q.ToString)
RadGrid1.DataBind()

Now I have created columns dynamically. I want to set the first column as a datetype column.

Protected Sub RadGrid1_PreRender(sender As Object, e As System.EventArgs) Handles RadGrid1.PreRender
 
    Dim expression As GridSortExpression = New GridSortExpression()
    expression.FieldName = "Column1"
 
    expression.SortOrder = GridSortOrder.Descending
    RadGrid1.MasterTableView.SortExpressions.AddSortExpression(expression)
 
    Dim dt As GridBoundColumn = RadGrid1.MasterTableView.GetColumnSafe("Column1")
 
    If dt IsNot Nothing Then
        'dt.DataType = TypeOf(DateTime.Now.ToString) << -- NOT WORKING
    End If
 
    RadGrid1.MasterTableView.Rebind()
End Sub

Is there anyway to set Datatype of a column from code-behind.
Princy
Top achievements
Rank 2
 answered on 25 Sep 2013
Narrow your results
Selected tags
Tags
+? more
Top users last month
Chester
Top achievements
Rank 1
Iron
Simon
Top achievements
Rank 1
Iron
Douglas
Top achievements
Rank 2
Iron
Iron
SUNIL
Top achievements
Rank 3
Iron
Iron
Iron
Marco
Top achievements
Rank 3
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Chester
Top achievements
Rank 1
Iron
Simon
Top achievements
Rank 1
Iron
Douglas
Top achievements
Rank 2
Iron
Iron
SUNIL
Top achievements
Rank 3
Iron
Iron
Iron
Marco
Top achievements
Rank 3
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?