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

I have relatively simple scenerio where I have to check some conditions before updating data. To manage data I'm using RadGrid with autoupdate. I would like to check some conditions before update (i.e. if the name already exists, if an issue date is greater then other max issue date in database etc.). What is the best practice to make such check and how to stop update if some conditions are not met?
I thought about SqlDataSource updating event but I don't know how to read values from controls in edit form of RadGrid. Maybe other event is much more efficient in this case. I appreciate your support in this case as well as snippet of example code is welcome.

Best Regards,

Darek
Iana Tsolova
Telerik team
 answered on 22 Aug 2011
5 answers
180 views
i have a RadGrid in a usercontrol.
i have an aspx page that contains the usercontrol and a RadFilter.
how can i assign the FilterContainerID of the RadFilter to the RadGrid?

i already tried to directly giving it the ID as such:

 

<telerik:RadFilter 

ID="rfCustomFilter" runat="server"FilterContainerID="RadGrid1"/>

and i have also tried to assign filterContainerID in code behind as such:
rfCustomFilter.FilterContainerID = "RadGrid1";

both did not work, and i get an error when Adding an expression:
Microsoft JScript runtime error: Sys.WebForms.PageRequestManagerServerErrorException: Index was out of range. Must be non-negative and less than the size of the collection.
Parameter name: index

Devman
Top achievements
Rank 1
 answered on 21 Aug 2011
4 answers
77 views
At RadGrid.ItemCreated() event, that button is already created.

At which event, the CommandItem (export to excel button) is created and added to the MasterTableView?

I'd need to add a custom button to the CommandItem.

Thanks,


Daniel
Telerik team
 answered on 21 Aug 2011
2 answers
110 views
 

Hi

How could I export the TreeList data to an excel sheet?

Regards
Kannan
Daniel
Telerik team
 answered on 21 Aug 2011
3 answers
176 views
I have the following table
<table>
    <tr>
        <td>First Row, Cell 1</td>
        <td>First Row, Cell 2</td>
    </tr>
    <tr>
        <td colspan="2">Second Row, Cell 1</td>
    </tr>
</table>

Can some suggest a RadGrid equivalent that allows me to keep the second row but the cells in the first row become GridBoundColumns?  I think it has to be GridBoundColumn, because this allows sorting by column.

J
Daniel
Telerik team
 answered on 21 Aug 2011
1 answer
67 views
I've got another RadGrid problem. One column in my grid is a DropDown that is getting its values from a SqlDataSource. The cell is defined as:
<telerik:GridDropDownColumn DataField="store" HeaderText="Store" UniqueName="store" DataSourceID="SqlDataSource2"
       ListTextField="store" ListValueField="store">
</telerik:GridDropDownColumn>

The drop down list is getting populated fine. I am using edit in place for the editing and can select a value from the list okay. On the back end for the update, I've got (in part):
protected void RadGrid1_UpdateCommand(object source, Telerik.Web.UI.GridCommandEventArgs e)
    {           
        string store = (editedItem["store"].Controls[0] as DropDownList).SelectedValue.ToString();
    }

I'm getting an error at run time after editing a row when I include that code. If I remove the code that adds the store drop down from the update, it works fine (but of course doesn't update that field.) I've tried other variations such as "string store = (editedItem["store"].Controls[0] as DropDownList).SelectedItem.Value" with no luck.

The error is "Message: Sys.WebForms.PageRequestManagerServerErrorException: Object reference not set to an instance of an object.
Line: 6
Char: 62099
Code: 0"

Any ideas? Thanks!
Susan
Top achievements
Rank 1
 answered on 20 Aug 2011
5 answers
901 views
Respected Sir/Madam,

I need to show checkboxes in one ComboBox. Now I want Server Side postback event, when user selects all desired checkboxes and clicks outside of ComboBox to close the ComboBox window. Is it possible? Currently SelectedIndexChanged is not working in this case. 

ASPX code:

 <telerik:RadComboBox runat="server" ID="ddlPopulation"  OnSelectedIndexChanged ="ddlPopulation_SelectedIndexChanged"
  OnItemDataBound="ddlPopulation_ItemDataBound" AllowCustomText="false" AutoPostBack="true" >
      <ItemTemplate>
            <asp:CheckBox runat="server" ID="chk"  />
      </ItemTemplate>
 </telerik:RadComboBox>


C# code

protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
  {
PopulatePopulation();
  }
}

 private void PopulatePopulation()
    {
        ddlPopulation.DataSource = Job.GetPopulations();
        ddlPopulation.DataTextField = "PopulationName";
        ddlPopulation.DataValueField = "PopulationID";
        ddlPopulation.DataBind();
    }

 protected void ddlPopulation_ItemDataBound(object sender, Telerik.Web.UI.RadComboBoxItemEventArgs e)
    {
        CheckBox chk = e.Item.FindControl("chk") as CheckBox;
        chk.Text = e.Item.Text;
    }

 protected void ddlPopulation_SelectedIndexChanged(object sender, RadComboBoxSelectedIndexChangedEventArgs e)
    {
//TODO: do some work
    }

Please help me how can I get server side event. On this Event I need to populate one another ComboBox.

Thanks
Paresh


Paresh Dehadray
Top achievements
Rank 1
 answered on 20 Aug 2011
2 answers
236 views
I have a column in a grid that is a certain width but the text in the column could be longer than the specified width.  If that happens I wanted to cut off the overflowing text (instead of wrapping) and replace it with an ellipsis.  The only way I could get this to work with CSS was to add the following styles to my page:

<style type="text/css">
div.RadGrid_Vista .rgRow td div,
div.RadGrid_Vista .rgAltRow td div
{
    white-space         : nowrap !important;
    overflow            : hidden !important;
    text-overflow       : ellipsis !important;
}
</style>

Next, I set the width to 150px in the ItemStyle for my column.  This didn't work, so after a lot of trial and error, I realized that those styles would only work on a DIV...not the TD tag that was being created in from the grid control.  To fix this, I added the following DataFormatString value to the GridBoundColumn:   DataFormatString="<div style='width:150px'>{0}</div>"

I had to add the width or else it didn't wrap and ignored the overflow and text-overflow settings.

Ok, so I got all of that to work, but now the last problem I'm having is when I click on the Edit button (EditForms mode), the selected row then expands in height and ignores the styles I added.

I've attached two images.  One that shows what I it looks in view mode, and the other showing what it looks like in edit mode.  I want both to look like the one in view mode (truncated with ellipsis).

Thanks,
Aaron
Aaron
Top achievements
Rank 1
 answered on 20 Aug 2011
6 answers
296 views
Hi, I use the example from RadRibbonBar, and the images are not displaying at all. What do I miss here? How can I find those icons using Skin="Office2007"

 

 

<telerik:RibbonBarTab Text="Home">

 <telerik:RibbonBarGroup Text="Clipboard" EnableLauncher="true">

 <Items>

 <telerik:RibbonBarMenu Size="Large" Text="Paste" ImageUrl="icons/home/Paste.png">

 <Items>

 <telerik:RibbonBarMenuItem Text="Paste" ImageUrl="icons/home/Paste.png" />

 

<telerik:RibbonBarMenuItem Text="Paste Special..." ImageUrl="icons/home/Paste.png" />

 </Items>

</telerik:RibbonBarMenu> <telerik:RibbonBarButton Size="Medium" Text="Cut" ImageUrl="icons/home/Cut.png" /> <telerik:RibbonBarButton Size="Medium" Text="Copy" ImageUrl="icons/home/Copy.png" />

 <telerik:RibbonBarButton Size="Medium" Text="Format" ImageUrl="icons/home/Format_Painter.png" />

 </Items>

 </telerik:RibbonBarGroup>

1)Here is part of the code. I don't know where those images are located?

2) Is there any default image in this control? I just want to see if I can use this control and have a quick way to access those image.

Jesper
Top achievements
Rank 1
 answered on 20 Aug 2011
0 answers
59 views
Hi
   I am using one Hierarchy Grid to display data.
<telerik:RadGrid ID="Grdaccountdraftavail" runat="server" AllowPaging="True" AllowMultiRowSelection="True"
                            ShowFooter="true" Skin="Office2007">
                            <PagerStyle AlwaysVisible="true" />
                            <MasterTableView Caption="<table style='background-color:Silver; width:100%; color:Black;text-align:center;'><tr><td>Accountwise Draft Availability</td></tr></table>"
                                DataKeyNames="Accountid">
                                <Columns>
                                    <telerik:GridClientSelectColumn UniqueName="Grdaccountdraftavail_select">
                                        <HeaderStyle HorizontalAlign="Center" Width="20px" />
                                        <ItemStyle HorizontalAlign="Center" Width="20px" />
                                    </telerik:GridClientSelectColumn>
                                </Columns>
                                <ExpandCollapseColumn Visible="True">
                                </ExpandCollapseColumn>
                                <DetailTables>
                                    <telerik:GridTableView Name="Providers" runat="server">
                                    </telerik:GridTableView>
                                </DetailTables>
                            </MasterTableView>
                            <ClientSettings EnableRowHoverStyle="true">
                                <Selecting AllowRowSelect="true" />
                            </ClientSettings>
                        </telerik:RadGrid>

I am trying to Expand it is expanding first time only after that it's not working. it showing the message like this "Microsoft JScript runtime error: Sys.WebForms.PageRequestManagerServerErrorException: Object reference not set to an instance of an object".

Can any body help me  to resolve this problem.

Thanks
Suresh K
Suresh K
Top achievements
Rank 1
 asked on 20 Aug 2011
Narrow your results
Selected tags
Tags
+? more
Top users last month
Cynthia
Top achievements
Rank 1
Iron
Toby
Top achievements
Rank 3
Iron
Iron
Iron
Danielle
Top achievements
Rank 1
Iron
Iron
Joel
Top achievements
Rank 3
Bronze
Bronze
Iron
yw
Top achievements
Rank 2
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Cynthia
Top achievements
Rank 1
Iron
Toby
Top achievements
Rank 3
Iron
Iron
Iron
Danielle
Top achievements
Rank 1
Iron
Iron
Joel
Top achievements
Rank 3
Bronze
Bronze
Iron
yw
Top achievements
Rank 2
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?