Telerik Forums
UI for ASP.NET AJAX Forum
1 answer
122 views
Hi,

I want hide particular row when export to PDF.

For Ex

Name                        Id
arun                        1001
bala                         1002
prabhu                     1003

i want name=bala means we need to hide only export to PDF.

Please give me a tips ASAP.

Thanks,
Dhamu.
Shinu
Top achievements
Rank 2
 answered on 20 Dec 2010
3 answers
83 views
Hi,

I am facing this unusual bug, I have a form in a RadGrid, at fourth level i have a RadDatePicker control which allows users to select the date and save the data.

Problem:
Sometimes the RadDatePicker is loading as a normal TextBox control and the image button which popups the calendar control is dissappearing. After several refresh, it loads normally. What is wrong in this control?

Please help.

Regards,
Sudhanva
Tsvetina
Telerik team
 answered on 20 Dec 2010
4 answers
93 views
Hi Team,

Always problems with RadGrids in admin side. This time is with pagin and automatic edit/update. I use one RadGrid ajaxified server side radgrid inside News Module Edit/Insert Template. The Dataset is external data.  I need to load and update one Dataset and after store. The Dataset is loading and the RadGrid is paging, but if you try to edit or Update any items the pager it come back to the first page and one item in the first at same level is edited or updated. I use preconised RadGrid Automatic sample and this issue has beed submit to RadGrid Forum but not found solution. Only items of first page can be Edited or Updated. I really need some help to fix this problem.

<telerik:RadGrid ID="PlanGrid" runat="server" Skin="WebBlue"  GridLines="None" Width="100%" OnNeedDataSource="PlanGrid_NeedDataSource"
OnItemCreated="PlanGrid_ItemCreated" OnUpdateCommand="PlanGrid_UpdateCommand" AutoGenerateColumns="False" AllowMultiRowEdit="True" ShowStatusBar="true" AllowPaging="True">
     <MasterTableView DataKeyNames="Week" Width="100%" CommandItemDisplay="Top" EditMode="InPlace" PageSize="14">
                   <Columns>
                     <telerik:GridTemplateColumn UniqueName="CheckBoxTemplateColumn">
                            <HeaderTemplate>
                             <asp:CheckBox id="headerChkbox" OnCheckedChanged="ToggleSelectedState" AutoPostBack="True" runat="server"></asp:CheckBox>
                            </HeaderTemplate>
                            <ItemTemplate>
                                <asp:CheckBox id="CheckBox1" OnCheckedChanged="ToggleRowSelection" AutoPostBack="True" runat="server"></asp:CheckBox>
                            </ItemTemplate>
                    </telerik:GridTemplateColumn>
                    <telerik:GridBoundColumn UniqueName="Week" SortExpression="Week" HeaderText="Sem." ReadOnly="true" DataField="Week" />   
                    <telerik:GridBoundColumn UniqueName="devise" SortExpression="devise" HeaderText="devise."       ReadOnly="true"DataField="devise" />    
                    <telerik:GridBoundColumn UniqueName="Days_1d"  HeaderText="Price"
                        DataField="Days_1d" >
                        <ItemStyle  Width="100px" />
                    </telerik:GridBoundColumn>
                     <telerik:GridBoundColumn UniqueName="Days_promo"  HeaderText="Discount(%)"
                        DataField="Days_promo" DataType="System.Int32">
                        <ItemStyle  Width="70px" />
                    </telerik:GridBoundColumn>             
                    
                    <telerik:GridEditCommandColumn UpdateText="Update" UniqueName="EditCommandColumn"
                        CancelText="Cancel" EditText="Edit">
                        <HeaderStyle Width="85px"></HeaderStyle>
                    </telerik:GridEditCommandColumn>
                </Columns>
                 <EditFormSettings CaptionFormatString="Semana {0}" CaptionDataField="Week" >
                    <FormTableItemStyle Width="100px" Height="29px"></FormTableItemStyle>
                    <FormTableStyle GridLines="None" CellSpacing="0" CellPadding="2"></FormTableStyle>
                    <FormStyle Width="100%" BackColor="#eef2ea"></FormStyle>
                    <EditColumn ButtonType="ImageButton" />
                </EditFormSettings>
          
                </MasterTableView>
    <ClientSettings EnableRowHoverStyle="true">
       
    </ClientSettings>
     <PagerStyle Mode="NumericPages"></PagerStyle>
</telerik:RadGrid>

Page load (old issue fixed by ivan link the ajaxmanager to ajaxify)
RadAjaxManager ajaxManager = RadAjaxManager.GetCurrent(this.Page);
if (ajaxManager != null)
{
    ajaxManager.AjaxSettings.Clear();
    ajaxManager.AjaxSettings.AddAjaxSetting(PlanGrid, PlanGrid);
}

 
protected void PlanGrid_NeedDataSource(object source, Telerik.Web.UI.GridNeedDataSourceEventArgs e)
        {
            this.PlanGrid.DataSource = PlanningData; //is a Dataset
        }
  
     protected void PlanGrid_ItemPreRender(object sender, EventArgs e)
        {
            ((sender as GridDataItem)["CheckBoxTemplateColumn"].FindControl("CheckBox1") as CheckBox).Checked = (sender as GridDataItem).Selected;
  
        }
        protected void ToggleRowSelection(object sender, EventArgs e)
        {
            ((sender as CheckBox).Parent.Parent as GridItem).Selected = (sender as CheckBox).Checked;
        }
        protected void ToggleSelectedState(object sender, EventArgs e)
        {
            if ((sender as CheckBox).Checked == true)
            {
                foreach (GridDataItem dataItem in PlanGrid.MasterTableView.Items)
                {
                    (dataItem.FindControl("CheckBox1") as CheckBox).Checked = true;
                    dataItem.Selected = true;
                }
            }
            else
            {
                foreach (GridDataItem dataItem in PlanGrid.MasterTableView.Items)
                {
                    (dataItem.FindControl("CheckBox1") as CheckBox).Checked = false;
                    dataItem.Selected = false;
                }
            }
        }
        protected void PlanGrid_UpdateCommand(object source, Telerik.Web.UI.GridCommandEventArgs e)
        {
            PlanGrid.MasterTableView.EditMode = GridEditMode.EditForms;
            GridEditableItem eeditedItem = e.Item as GridEditableItem;
            GridEditManager editMan = editedItem.EditManager;
  
            foreach (GridColumn column in e.Item.OwnerTableView.RenderColumns)
            {
                if (column is IGridEditableColumn)
                {
                    IGridEditableColumn editableCol = (column as IGridEditableColumn);
                    if (editableCol.IsEditable)
                    {
                        IGridColumnEditor editor = editMan.GetColumnEditor(editableCol);
  
                        string editoreditorType = editor.ToString();
                        string editorText = "unknown";
                        object editorValue = null;
  
                        if (editor is GridTextColumnEditor)
                        {
                            editorText = (editor as GridTextColumnEditor).Text;
                            editorValue = (editor as GridTextColumnEditor).Text;
                        }
  
                        if (editor is GridBoolColumnEditor)
                        {
                            editorText = (editor as GridBoolColumnEditor).Value.ToString();
                            editorValue = (editor as GridBoolColumnEditor).Value;
                        }
  
                        if (editor is GridDropDownColumnEditor)
                        {
                            editorText = (editor as GridDropDownColumnEditor).SelectedText + "; " +
                                (editor as GridDropDownColumnEditor).SelectedValue;
                            editorValue = (editor as GridDropDownColumnEditor).SelectedValue;
                        }
  
                        try
                        {
                            DataRow[] changedRows = PlanningData.Tables[0].Select("Week= " + editedItem.OwnerTableView.DataKeyValues[editedItem.ItemIndex]["Week"]);
                            changedRows[0][column.UniqueName] = editorValue;
                            PlanningData.Tables[0].AcceptChanges();
                        }
                        catch (Exception ex)
                        {
                            PlanGrid.Controls.Add(new LiteralControl("<strong>Error '" + column.UniqueName + "'</strong> - " + ex.Message));
                            e.Canceled = true;
                            break;
                        }
                    }
                }
            }
            editedItem.Edit = false;
        }

Help.
Iana Tsolova
Telerik team
 answered on 20 Dec 2010
1 answer
77 views
hi, all
i am using RadGrid in my application , i am binding the grid with database values and my db table contains some real data type field
for those values (real data type field) radgrid displaying wrong
for example :- in my table value is 13.4
my radgrid is showing this value like 13.3987654321

even i used data-format string expression then also it is displaying  wrong value
it's not rounding up that value.
i used following expression
{0:####0.###}
{0:F3}%
{0:000.0}

and the code is below
 <telerik:GridBoundColumn DataField="MinimumQuantityForOrdering" HeaderText="Min. Order Qty "
                                        UniqueName="MinimumQuantityForOrdering" DataFormatString ="{0:F3}%"
                                        AutoPostBackOnFilter="true" CurrentFilterFunction="GreaterThanOrEqualTo">
                                        <ItemStyle HorizontalAlign="Left" />
                                        <HeaderStyle  Width ="10%" Wrap="true" />
                                    </telerik:GridBoundColumn>
Tsvetoslav
Telerik team
 answered on 20 Dec 2010
1 answer
93 views
Hi,
I have a grid, similar to “Grid / User Control Edit Form” sample, and I want to implement confirmation, if user changes value in edit form and accidentally switch to other record without saving, something like this: http://aspnet.4guysfromrolla.com/articles/101304-1.aspx
Perhaps Telerik grid already have something built-in, which I missed? if no – how can I get clientid of textboxes on user control edit form?

Thanks
Alex
Vasil
Telerik team
 answered on 20 Dec 2010
3 answers
116 views
My scheduler becomes unintelligible if there are more than two overlapping appointments, because the columns have a fixed width that really barely handles two appointments side by side.  I would like the columns to expand to accommodate an unlimited number of overlapping appointments.

Here's my Scheduler:

<telerik:RadScheduler ID="schPlanner" AllowDelete="true" AllowEdit="false" AllowInsert="false"
    DataDescriptionField="Description" DataEndField="TimeEnd" DataKeyField="AppointmentKey"
    DataStartField="TimeStart" DataSubjectField="Subject"
    DayEndTime="22:00:00" DayStartTime="06:00:00" FirstDayOfWeek="Sunday" Height="100%"
    OverflowBehavior="Expand" RowHeight="21px" runat="server" SelectedView="WeekView"
    ShowAllDayRow="false" ShowFooter="false" ShowHeader="false" Skin="Web20" ToolTip=""
    Width="800" WorkDayEndTime="22:00:00" WorkDayStartTime="06:00:00">
    <Localization ConfirmDeleteText="Are you sure you want to delete this class?" />
    <WeekView ColumnHeaderDateFormat="dddd" />
    <AppointmentTemplate>
        <%#Eval("Subject")%>
    </AppointmentTemplate>
</telerik:RadScheduler>

Thanks,
Helen
Telerik team
 answered on 20 Dec 2010
3 answers
117 views
Hi, I have a problem with a Radtreeview in a masterPage, I try to save the expanded nodes state in a Session variable and shows me InvalidOperationException and cannot create the xml file.
Session("myTreeView") = Tree1.GetXml
I want to save the treeview state and load it in other page like the nodes where in the first page.
Could you help me?
Thanks. 
jose antonio
Top achievements
Rank 1
 answered on 20 Dec 2010
1 answer
49 views
Hi,

I´d like to do a C.R.U.D webform and I need to deny the edit of controls on it.

How can I do that?

tks

Luiz
Dobromir
Telerik team
 answered on 20 Dec 2010
1 answer
121 views
I'm trying to load an RTF document that we retrieve from a database when a user clicks on an ImageButton on a row in a standard ASP.net gridview. The code seems to get called (RowCommand on server side) to load the RTF but when the dialog is displayed it is blank. It is as if the dialog has been loaded and the callback to load the RTF is ignored.

In ASPX page I have:

<!-- Model Definition Viewer -->
<div id="Viewer">
  <twu:RadEditor runat="server" ID="DefViewer" Enabled="false" EditModes="Design" BorderStyle="None" Skin="Office2007">
    <Content>
    </Content>
  </twu:RadEditor>
</div>
<asp:UpdatePanel ID="GridUpdatePanel" runat="server" ChildrenAsTriggers="False" 
                    UpdateMode="Conditional">
  <ContentTemplate>
    <asp:GridView ID="ModelList" runat="server" AutoGenerateColumns="False" AutoGenerateSelectButton="false"
                        AllowPaging="true" CssClass="GridView" Width="600px" HorizontalAlign="Center" HeaderStyle-Height="40px">
                        <Columns
                          <asp:TemplateField HeaderStyle-Width="20px">
                            <ItemTemplate>
                              <asp:ImageButton ID="InfoPopup" Width="15px" ToolTip="Click to display full model definition" Style="border: 0px"
                                               runat="server" ImageUrl="~/Images/definition.gif" CommandName="Definition" />
                            </ItemTemplate>
                          </asp:TemplateField>
                          <asp:BoundField DataField="ModelID" />
                                    <asp:TemplateField HeaderText="Model Name" SortExpression="Name" HeaderStyle-Width="350px">
                                        <ItemTemplate>
                                            <asp:LinkButton style="text-decoration:none" ID="ModelNameHyperLink" runat="server" CommandName="Select" CommandArgument='<%# Container.DataItemIndex %>' Text='<%# Eval("ModelName") %>' Font-Bold="True"></asp:LinkButton>
                                        </ItemTemplate>
                                    </asp:TemplateField>
                                    <asp:BoundField DataField="ProviderId" />
                          <asp:BoundField DataField="Provider" HeaderText="Provider" HeaderStyle-Width="290px"/>
                        </Columns>
                        <AlternatingRowStyle CssClass="GridAlternating" />
                        <RowStyle CssClass="rowStyle" />
                        <PagerSettings Mode="NumericFirstLast" />
                        <SelectedRowStyle BackColor="#66CCFF"  Font-Bold="true" ForeColor="Black"  />
                      </asp:GridView
                    </ContentTemplate>
                    <Triggers>
                      <asp:AsyncPostBackTrigger ControlID="ModelList" EventName="PageIndexChanged" />
                      <asp:AsyncPostBackTrigger ControlID="ModelList" EventName="SelectedIndexChanged" />
                      <asp:AsyncPostBackTrigger ControlID="ModelList" EventName="RowCommand" />
                    </Triggers>
                  </asp:UpdatePanel>

Code Behind contains:

Protected Sub OnRowCommand(ByVal sender As Object, ByVal e As GridViewCommandEventArgs) Handles ModelList.RowCommand
  
 Try
    Select Case e.CommandName
    Case "Definition"
                    Dim RowIndex As Integer = Integer.Parse(e.CommandArgument.ToString)
                    Dim ModelID As String = Me.ModelList.Rows(RowIndex).Cells(ModelListColumnEnum.ModelId).Text
                    Dim ProviderId As String = Me.ModelList.Rows(RowIndex).Cells(ModelListColumnEnum.ProviderId).Text
  
                    'Get the Definition for the specified model/provider and display it.
                                       Try
                        Dim ModelDefinition As String = String.Empty
                        Dim ErrorDetails As String = String.Empty
                        If JiatClient.GetModelDefinition(ProviderId, ModelID, ModelDefinition, ErrorDetails, Utilities.CurrentJIATUser(Session).UserID) Then
                            Me.DefViewer.LoadRtfContent(ModelDefinition)
                        Else
                            Me.DefViewer.Content = "Either this model doesn't have a definition or it could not be loaded."
                        End If
 ScriptManager.RegisterClientScriptBlock(Page, Me.GetType, "FileOpen", "openDialog('Viewer');", True)
                    Catch ex As System.Exception
                        ThrowErrorMessage(ex.Message)
                    Finally
                        'We do some cleanup in here
     
                    End Try

openDialog is javascript jquery code in a separate js file. The code all seems to work except that the radeditor comes up empty. My only thought is that it is because the radeditor is loaded when the page is loaded and on every postback. the only way I could probably get this to work is to check in page load and see if I have a hiddenfield or something set to the RTF. Any ideas? I'm sure people will need more information.
Dobromir
Telerik team
 answered on 20 Dec 2010
1 answer
97 views
Hi Team

I'm trying to pass a value and redirect to another page based on the row user select. The code works fine on my local PC but after I deployed the application to the dev. server the following error is returned (54) Connection reset by peer. after clicking the select button.

 

 

 

protected void RadAnswers_ItemCommand(object sender,GridCommandEventArgs e)
{

 

if (e.CommandName == RadGrid.EditCommandName)
{
 
CreditLifeManager.AnswerID = Convert.ToInt64(RadGridQuestionnaire.SelectedItems[0].OwnerTableView.DataKeyValues[RadGridQuestionnaire.SelectedItems[0].ItemIndex]["AnswerID"]);Response.Redirect("MaintenancePortal/EvaluateQuestionnaireSection1.aspx");

 

 

 

 

    }

 

}

Dev. server is running Windows Server 2003 and running IIS7.5.
Can anyone asssist me on this issue or i'm missing to set configuration.
Any advice will be greatly appreciated

Thanks in advance


Radoslav
Telerik team
 answered on 20 Dec 2010
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?