Telerik Forums
UI for ASP.NET AJAX Forum
2 answers
91 views
Hi,

I have a grid and some user roles.

I would like to do the following,

when a user would like to edit the gridrow open a popup edit form but some of the controls set disabled or invisible based on the user role.

What is the best solution with telerik controls  for this?

Thanks.
Csaba
Top achievements
Rank 1
 answered on 12 Apr 2013
3 answers
318 views
Hello, I have several radcombobox controls in my aspx/c# web application.

- The radcombobox has the "Checkbox" parameter set to "true"
- the control is populated from codebehind on page load
- the control is held within RadAjaxPanel and ASP UpdatePanel

scenario: When i 'check' an item from the radcombobox, it shows the loading image and fires the OnSelectedIndexChanged event from code behind as supposed to. But when everything is completed, radcombobox on my page shows that no item has been selected... weird thing is when i select the same item from the same radcombox "again", it shows my selection properly.

So to sum it up, I have to select the item 'twice' for it to work right.

Am i doing something wrong? I just want the item to 'stay' selected from the first try without having to select it again.

ASPX:

<telerik:RadAjaxPanel ID="ProductsRadAjaxP" runat="server" LoadingPanelID="RadAjaxLoadingPanel1" RequestQueueSize="50">
    <asp:UpdatePanel ID="UpdatePanel1" UpdateMode="Conditional" runat="server">
        <ContentTemplate>
             <table width="100%">
              <tr>
                <td>
                  <asp:Label ID="lbl_Country" runat="server" Text="Country: " />
                 </td>
                 <td>
                  <telerik:RadComboBox ID="cmb_Country" runat="server" Height="200" Width="160" EmptyMessage="Choose Country" MarkFirstMatch="true" EnableLoadOnDemand="true" AutoPostBack="true" CheckBoxes="true" EnableCheckAllItemsCheckBox="true" Filter="Contains" OnSelectedIndexChanged="cmb_Country_SelectedIndexChanged">
                  </telerik:RadComboBox>
                 </td>
                </tr>
                <tr>
                 <td>
                    <asp:Label ID="lbl_Casa" runat="server" Text="Casa: " />
                 </td>
                 <td>
                  <telerik:RadComboBox ID="cmb_Casa" runat="server" Height="200" Width="160" EmptyMessage="Choose Casa" MarkFirstMatch="true" EnableLoadOnDemand="true" AutoPostBack="true" CheckBoxes="true" EnableCheckAllItemsCheckBox="true" Filter="Contains" OnSelectedIndexChanged="cmb_Casa_SelectedIndexChanged">
                                                </telerik:RadComboBox>
                 </td>
             </tr>
                  <!-- there are alot more controls, but all with the same parameter -->
         </table>
        </ContentTemplate>
    </asp:UpdatePanel>
 <telerik:RadAjaxLoadingPanel ID="RadAjaxLoadingPanel1" runat="server" Transparency="1" Skin="Metro">
 </telerik:RadAjaxLoadingPanel>

C#:

    protected void cmb_Country_SelectedIndexChanged(object sender, EventArgs e)
    {
        //I have a long process and SQL procedures... this is just an example of how i'm filling the control
        cmb_Casa.DataSource = DataHelper.GetCasa(cmb_Country.CheckedItems[0].Value);
           cmb_Casa.DataBind();
    }
.
.
.
.


Nencho
Telerik team
 answered on 12 Apr 2013
4 answers
794 views
Hello Everyone,

I am using export to pdf feature in one of my grid.
Now my problem is data is overlapped in two columns while export to pdf file.

I had faced similar behavior while displaying rad grid and corrected by using following property
<MasterTableView TableLayout="Auto">
<ClientSettings>
      <Resizing ClipCellContentOnResize="false">
</ClientSettings>
</MasterTableView>

So my data overlap into 2 columns each other is resolved but similar issue i am facing while export same content to pdf

Seems rad grid not reading columns properties while exporting.

So any one have idea how to resolve it?

Regards,

Dharmesh

Kostadin
Telerik team
 answered on 12 Apr 2013
4 answers
226 views
I've been searching everywhere and not found the right combination of what will fix my problem. I have a DetailTables inside a grid, It has the internal Add new record from the CommandItemDisplay and a GridEditCommandColumn. It is using an FormTemplate for Editing and in that formtemplate I have a Label which is filled with the VcnCd from the parent grid. My problem is that when I click on the edit button that label is filled correctly with the VcnCd, but when I click the Add new button that label is empty. I have spent a lot of hours trying to find how to fill that label in the code behind with no luck. the label I'm trying to fill with the correct value is lblvType. I could use some help I'm doing this in VB. Here is my grid.
 
<telerik:RadGrid ID="grdVcntn" runat="server" AutoGenerateColumns="false">
  <ClientSettings>
    <Scrolling AllowScroll="True" UseStaticHeaders="True" />
  </ClientSettings>
  <MasterTableView EditMode="PopUp" CommandItemDisplay="Top" ShowHeader="true" AutoGenerateColumns="false" DataKeyNames="VcnCd">
     <NoRecordsTemplate>
      There are no records for this person.
    </NoRecordsTemplate>
    <CommandItemTemplate>
      <asp:LinkButton ID="LinkButton1" runat="server" CommandName="InitInsert" >
        <img style="border:0px" alt="Add" src="../images/plus.gif" /> Add new Record
      </asp:LinkButton>
    </CommandItemTemplate>
    <Columns>
      <telerik:GridEditCommandColumn ButtonType="imageButton" EditImageUrl="../images/Edit.gif"></telerik:GridEditCommandColumn>
      <telerik:GridBoundColumn HeaderText="VcnCd" DataField="VcnCd" UniqueName="VcnCd"></telerik:GridBoundColumn>
      <telerik:GridBoundColumn HeaderText="VcnNm" DataField="VcnNm" UniqueName="VcnNm"></telerik:GridBoundColumn>
    </Columns>
    <EditFormSettings InsertCaption="Add record" CaptionDataField="VcnCd" CaptionFormatString="Edit record: {0}"
      EditFormType="Template" PopUpSettings-Modal="true" PopUpSettings-Height="260px" PopUpSettings-Width="500px">
      <FormTemplate>
        <table>
          <tr>
            <td>
              Code: <asp:DropDownList ID="dpdVcnCd" DataTextField="VcnNm" DataValueField="VcnCd" SelectedValue='<%# Bind("VcnCd") %>' 
              runat="server" DataSourceID="SqlDataSource1"></asp:DropDownList>
            </td>
          </tr>
          <tr>
            <td>
              <asp:Button ID="btnSubmitVcnCd" Text='<%# Iif(typeof Container is GridEditFormInsertItem, "Insert", "Update") %>'
                runat="server" CommandName='<%# Iif(TypeOf Container is GridEditFormInsertItem, "PerformInsert", "Update") %>'
                CommandArgument='<%# Eval("VcnCd") %>' />
              <asp:Button ID="btnCancelVcnCd" Text="Cancel" runat="server" CausesValidation="false" CommandName="Cancel" />
            </td>
          </tr>
        </table>
      </FormTemplate>
    </EditFormSettings>
    <DetailTables>
      <telerik:GridTableView Name="DetailTables" EditMode="PopUp" DataKeyNames="ID" DataSourceID="SqlDataSource3"
        Width="100%" runat="server" CommandItemDisplay="Top">
        <ParentTableRelation>
          <telerik:GridRelationFields DetailKeyField="VcnCd" MasterKeyField="VcnCd" />
        </ParentTableRelation>
        <Columns>
          <telerik:GridEditCommandColumn ButtonType="ImageButton" EditImageUrl="../images/Edit.gif" UniqueName="Edit"></telerik:GridEditCommandColumn>
          <telerik:GridBoundColumn HeaderText="ID" DataField="ID" UniqueName="ID"></telerik:GridBoundColumn>
          <telerik:GridBoundColumn HeaderText="VcnCd" DataField="VcnCd" UniqueName="VcnCd"></telerik:GridBoundColumn>
          <telerik:GridBoundColumn HeaderText="Date" DataField="VcntnDt" UniqueName="VcntnDt" DataFormatString="{0:d}"></telerik:GridBoundColumn>
        </Columns>
        <EditFormSettings InsertCaption="Edit Item" CaptionFormatString="Edit ID: {0}" CaptionDataField="ID" EditFormType="Template"
          PopUpSettings-Modal="true" PopUpSettings-Height="260px" PopUpSettings-Width="400px">
          <PopUpSettings Modal="true" />
          <EditColumn UniqueName="EditCommandColumn1" ButtonType="ImageButton" InsertImageUrl="../images/plus.gif" EditImageUrl="../images/Edit.gif"></EditColumn>
          <FormTemplate>
            <table id="tblEditVcnDte">
              <tr>
                <td colspan="2" align="left">Vaccination Type: <asp:Label ID="lblvType" Text='<%# Bind("VcnCd") %>' runat="server"></asp:Label></td>
              </tr>
              <tr>
                <td align="right">Date :</td>
                <td>
                  <asp:TextBox ID="txtVcnDte" runat="server" Text='<%# Bind("VcntnDt","{0:d}") %>'></asp:TextBox>
                </td>
              </tr>
            </table>
            <table style="width: 100%">
              <tr>
                <td align="right" colspan="2">
                  <asp:Button ID="btnSubmitVcn" Text='<%# Iif(typeof Container is GridEditFormInsertItem, "Insert", "Update") %>'
                    runat="server" CommandName='<%# Iif(TypeOf Container is GridEditFormInsertItem, "InsertCdDt", "UpdateCdDt") %>'
                    CommandArgument='<%# Eval("ID") %>'  />
                  <asp:Button ID="btnCancelVcn" Text="Cancel" runat="server" CausesValidation="false" CommandName="Cancel" />
                </td>
              </tr>
            </table>
          </FormTemplate>
        </EditFormSettings>
      </telerik:GridTableView>
    </DetailTables>
  </MasterTableView>
  <ClientSettings>
    <ClientEvents OnPopUpShowing="PopUpShowing" />
    <Selecting AllowRowSelect="true" />
  </ClientSettings>
 
</telerik:RadGrid>
mike
Top achievements
Rank 1
 answered on 12 Apr 2013
2 answers
675 views
Hello.

I'm using a GridImageColumn in a document management scenario to display a small thumbnail of the document being referred to by each row in my grid.  I create the image column in code-behind, because my grid column set is somewhat dynamic based on configuration of our product.  In the method that creates the GridImageColumn, I have the following code:

gridView.Columns.Add(imageColumn);
imageColumn.HeaderText = label;
imageColumn.ImageHeight = 30;
imageColumn.ImageWidth = 30;

When I use this, my images are sized to the exact size specified, where I had instead hoped that it would create a bounding box around the image and preserve the aspect ratio of the image.

Is there any straightforward way to preserve the aspect ratio?
David
Top achievements
Rank 1
 answered on 12 Apr 2013
1 answer
310 views
asp.net

So I have a Grid that users enter data in (no surpise there) and then they hit a submit button to submit the changes to the database.

In the ItemDataBound event I determine if the field is a text box, then determine if I should set it multi or single line (if it is under a certain number of characters, it will stay singline.)

Dim txt As TextBox = CType(e.Item.FindControl("txtValue"), TextBox)
txt.TextMode = TextBoxMode.MultiLine

I am trying to figure out how to do this same logic on the client side in javascript.

function processValueChange(sender, rowID) {
     var myTextValue = row.findElement("Value");
     myTextValue = Multiline;
}

I do not know if you can set the mode like this on the fly without rebinding the grid...

Also the reason I do not set the MultiLine always to true on textboxes is because of the scrollbar that shows up in the multiline text box.  It is very distracting to see a bunch of little arrows in all my text box fields and would like them visible only when necessary.  Unless there is a way to get ride of them.
Eyup
Telerik team
 answered on 12 Apr 2013
1 answer
210 views
Dear Telerik Team,

We are using Rad Multi page (Tab) control. if we want to Hide/Show Panel Control at client side. we could not do that since object itself not available. it is an content page with Rad Multi page. we tried with Div also. we could not hide / show that control on run time at client side. This behaviour works if its without rad multi page. 

if we hide the control by setting visible properties of Panel at design time. it is not rendered to client side at all. 
but for Div Tag if use Style display:None,it is rendering at client side but not hiding the div tag.

the above functionality works without rad multi page

Requesting your help on the same.


With Regadrs
Palanivelrajan



Nencho
Telerik team
 answered on 12 Apr 2013
1 answer
191 views
Hi
How can I give background image to my radbutton. Please help me out.

thank you
Allen
Princy
Top achievements
Rank 2
 answered on 12 Apr 2013
1 answer
125 views

Hello,

Have custom EditFormSettings with a delete button that is wired to a postback event handler.

<EditFormSettings>
...
<FormTemplate>
...

<telerik:RadButton ID="btnDelete" Text="Delete" Visible='<%# (Container is GridEditFormInsertItem) ? false : true %>' runat="server" CausesValidation="false" Icon-PrimaryIconCssClass="rbRemove" Icon-PrimaryIconLeft="4" Icon-PrimaryIconTop="4" onclick="btnDelete_Click"/>


</FormTemplate>
</EditFormSettings>
<LinqDataSource ...

code

 

dataContext.TableName.DeleteOnSubmit(item);

 

sdb.SubmitChanges();

rgFormEmail.DataBind()

Grid is shown and edit button is hidden. Code below resolves but why would the edit column be hidden?

rgFormEmail.MasterTableView.GetColumn("BtnEdit").Visible = true;

 

 

Kostadin
Telerik team
 answered on 12 Apr 2013
3 answers
333 views
Hi
     How to change the selection color of items in combobox inside itemtemplate of radgrid. Please suggest a solution
thanks
Savyo
Princy
Top achievements
Rank 2
 answered on 12 Apr 2013
Narrow your results
Selected tags
Tags
+? more
Top users last month
Grant
Top achievements
Rank 3
Iron
Iron
Iron
Dean
Top achievements
Rank 1
Leland
Top achievements
Rank 2
Iron
Iron
Iron
Emil
Top achievements
Rank 1
Iron
Robert
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Top users last month
Grant
Top achievements
Rank 3
Iron
Iron
Iron
Dean
Top achievements
Rank 1
Leland
Top achievements
Rank 2
Iron
Iron
Iron
Emil
Top achievements
Rank 1
Iron
Robert
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?