Telerik Forums
UI for ASP.NET AJAX Forum
0 answers
127 views
Ok i need to download data feed file (XML) and it works fine except that i cannot show up the progress bar.

WebClient client = new WebClient(); 
client.DownloadFile(@"http://feed.sitename.com/page.aspx?param=value", System.IO.Path.Combine(Server.MapPath("~"), "latestdata.xml")); 
client.Dispose(); 

What rad ajax controls i need to use in order to display the progress and where to place my code?

Thanks



El
Top achievements
Rank 1
 asked on 10 Aug 2009
1 answer
293 views
Hi,

I added an image button into a radgrid but i dont want it to do anything therefore I would like to find out if we can disable the click. I want users to see the image not click it.

Thanks
Shinu
Top achievements
Rank 2
 answered on 10 Aug 2009
3 answers
201 views
I would like to do something similar to the "Load on Demand" and "First Look" example.  I have several asp:LinkButton's  .  Onmouse over, I would like to load a user control.  Does anyone have an example of how to do this not using the code behind.  I am not loading data from a DB.  I seems that all the examples say its possible to put the information inline, but when I view the actual code, all the examples use code behind and load from a DB.  Anyone??
Svetlina Anati
Telerik team
 answered on 10 Aug 2009
1 answer
617 views

The following code (called from RadGrid_PreRender) will iterate through a radgrid (and 3 nested tables) and hide the expand button if the row has no child records. I pieced this together from samples on this forum.

1) The MasterTableView is first populated by a call to NeedDataSource
2) The rows for the related nested tables are called by the DetailTableDataBind method
3) HierarchyLoadMode="ServerOnDemand" for all 4 tables ("Client" is not acceptable due to number of records)

 

 

 

Now, the last 3 lines of code (below, currently commented out) will collapse the MasterTableView nicely. However, upon expanding a row from that MasterTableView, the nested tables within are all expanded - not collapsed - as I need them to be. 

I have exhausted so many possibilities, so I finally posted this here. Note: This is not a question of how to hide the expand column (as is discussed in previous posts). Rather, it is a matter of making already collapsed tables STAY collapsed when the MasterTableView is expanded.

I suspect the problem lies within the DetailTableDataBind being called by ServerOnDemand after the MasterTableView row is clicked (thusly, repopulating the tables and overwriting any hiding/collapsing that has already been perfomed). Basically, I really need to know how to call "HideExpandColumnRecursive" on NESTED detail tables after they are created (which happens after a MasterTableView has been expanded). Complicated, I know. Any help would be greatly appreciated.

 

Protected

 

Sub RadGrid1_PreRender(ByVal sender As Object, ByVal e As EventArgs)

 

 

If Not IsPostBack Then

 

 

 

HideExpandColumnRecursive(RadGrid1.MasterTableView)

 

 

End If

 

 

End Sub

 

 

 

Public

 

Sub HideExpandColumnRecursive(ByVal tableView As GridTableView)

 

 

Dim nestedViewItems As GridItem() = tableView.GetItems(GridItemType.NestedView)

 

 

For Each nestedViewItem As GridNestedViewItem In nestedViewItems

 

 

For Each nestedView As GridTableView In nestedViewItem.NestedTableViews

 

 

If nestedView.Items.Count = 0 Then

 

 

Dim cell As TableCell = nestedView.ParentItem("ExpandColumn")

 

 

Dim expandCollapseButton As Button = CType(cell.Controls(0), Button)

 

expandCollapseButton.Visible =

False

 

nestedViewItem.Visible =

False

 

 

End If

 

 

If nestedView.HasDetailTables Then

 

HideExpandColumnRecursive(nestedView)

 

End If

 

 

Next

 

 

Next

 

 

'For Each item As GridDataItem In RadGrid1.MasterTableView.Items

 

 

' item.Expanded = False

 

 

'Next

 

 

End Sub

 

Mira
Telerik team
 answered on 10 Aug 2009
3 answers
104 views
Hello all,
I have one problem with Date Picker Telerik Control that after selecting date, cursor is not focused properly to the corresponding textbox.

Thanx for any kind of help.

Regards,
Nirav
nirav
Top achievements
Rank 1
 answered on 10 Aug 2009
3 answers
292 views
Hi,

I have a grid with 4 columns:
Column 1 - an editable GridDateTimeColumn which displays and accepts a date
Column 2 - an editable GridNumericColumn which displays and accepts an integer
Column 3 - an editable GridBoundColumn which displays and accepts a string
Column 4 - a GridEditCommandColumn

The grid is created at runtime (instead of at design time).

I get the following error message:
"Editor cannot be initialized for column: Date"
when I exit from the edit mode by either clicking Update or Cancel button on the GridEditCommandColumn.

Can you please show me what I have missed or done wrong in my code?

The web page is available on http://www.gouw.ws/RadGrid/DynamicGrid.aspx

The source code is given below:

ASPX:
=====
<form id="form1" runat="server">
<div>
    <telerik:RadScriptManager ID="radScriptManager" runat="server" />
    <telerik:RadGrid ID="radGrid" AutoGenerateColumns="false" GridLines="Vertical" OnNeedDataSource="radGrid_NeedDataSource" OnUpdateCommand="radGrid_UpdateCommand" runat="server">
        <ClientSettings>
            <Scrolling UseStaticHeaders="true" />
        </ClientSettings>
        <MasterTableView EditMode="InPlace" TableLayout="Fixed">
        </MasterTableView>
    </telerik:RadGrid>
</div>
</form>

C#:
===
public partial class DynamicGrid : System.Web.UI.Page
{
    private List<Data> _data = null;

    protected void Page_Load(object sender, EventArgs e)
    {
        BuildGrid();

        if (!IsPostBack)
        {
            this._data = Data.Load();
            Session["DATA"] = this._data;
        }
        else
        {
            this._data = (List<Data>)Session["DATA"];
        }
    }

    protected void radGrid_NeedDataSource(object source, GridNeedDataSourceEventArgs e)
    {
        this.radGrid.DataSource = this._data;
    }

    protected void radGrid_UpdateCommand(object sender, GridCommandEventArgs e)
    {
        if (e.Item is GridEditableItem && e.Item.IsInEditMode)
        {
            GridEditableItem item = e.Item as GridEditableItem;
            ((Data)(this._data[item.ItemIndex])).Date = (item["Date"].Controls[0] as RadDatePicker).SelectedDate.Value.Date;
            ((Data)(this._data[item.ItemIndex])).Value = int.Parse((item["Value"].Controls[0] as RadNumericTextBox).Text);
            ((Data)(this._data[item.ItemIndex])).Description = (item["Description"].Controls[0] as TextBox).Text;
        }
    }

    private void BuildGrid()
    {
        this.radGrid.Columns.Clear();

        GridDateTimeColumn dateColumn = new GridDateTimeColumn();
        dateColumn.DataField = "Date";
        dateColumn.HeaderText = "Date";
        dateColumn.UniqueName = "Date";
        this.radGrid.Columns.Add(dateColumn);
        this.radGrid.MasterTableView.Columns[0].HeaderStyle.Width = Unit.Percentage(13);
        this.radGrid.MasterTableView.Columns[0].ItemStyle.HorizontalAlign = HorizontalAlign.Left;

        GridNumericColumn valueColumn = new GridNumericColumn();
        valueColumn.DataField = "Value";
        valueColumn.HeaderText = "Value";
        valueColumn.UniqueName = "Value";
        this.radGrid.Columns.Add(valueColumn);
        this.radGrid.MasterTableView.Columns[1].HeaderStyle.Width = Unit.Percentage(13);
        this.radGrid.MasterTableView.Columns[1].ItemStyle.HorizontalAlign = HorizontalAlign.Left;

        GridBoundColumn descriptionColumn = new GridBoundColumn();
        descriptionColumn.DataField = "Description";
        descriptionColumn.HeaderText = "Description";
        descriptionColumn.UniqueName = "Description";
        this.radGrid.Columns.Add(descriptionColumn);
        this.radGrid.MasterTableView.Columns[2].HeaderStyle.Width = Unit.Percentage(64);
        this.radGrid.MasterTableView.Columns[2].ItemStyle.HorizontalAlign = HorizontalAlign.Left;

        GridEditCommandColumn editColumn = new GridEditCommandColumn();
        editColumn.ButtonType = GridButtonColumnType.LinkButton;
        editColumn.UniqueName = "Edit";
        this.radGrid.Columns.Add(editColumn);   
    }
}

public class Data
{
    public DateTime Date { get; set; }
    public int Value { get; set; }
    public string Description { get; set; }

    public Data(DateTime date, int value, string description)
    {
        Date = date;
        Value = value;
        Description = description;
    }

    public static List<Data> Load()
    {
        List<Data> data = new List<Data>();
        data.Add(new Data(DateTime.Now, 1, "This date is today"));
        data.Add(new Data(DateTime.Now.AddDays(1), 2, "This date is tomorrow"));
        data.Add(new Data(DateTime.Now.AddDays(2), 3, "This date is the day after tomorrow"));
        return data;
    }
}

Thanks & regards,
Herman Gouw
Skype: hermangouw
Yavor
Telerik team
 answered on 10 Aug 2009
1 answer
84 views
I finally changed my way to bind and used the new linqdatasource. The problem i have ist that ItemDataBound not works as expected. I thought that using an entity (e.g. user) in the linq datasource i should get the entity in itemdatabound via e.Item.DataItem.

What's wrong? How to get the data? Do i really have to reread the data on the database?
Nikolay Rusev
Telerik team
 answered on 10 Aug 2009
1 answer
64 views
Hi,
1.I am using the radCombo box in my project, In design time the following error comes "Could not load for assembly "Telerik.Web.Ui,Version=2009.2701.35,Culture=neutral, PublicKeyToken=121fae78165ba3d4' or one of its dependencies the system cannot find the file specified".

2.I could able to Run the application.

Thanks
Sabarish
Helen
Telerik team
 answered on 10 Aug 2009
1 answer
139 views
I have a RadGrid with a datatable as it's source.
I have AllowCustomPaging set to true.

    <telerik:RadGrid runat="server" ID="RadGridSearchResults" 
    PageSize="50" AllowPaging="true" AllowCustomPaging="true" 
    OnNeedDataSource="RadGridSearchResults_NeedDataSource" Skin="Default"> 
    <PagerStyle Mode="NextPrevNumericAndAdvanced" /> 
    </telerik:RadGrid> 


The code for my code behind method RadGridSearchResults_NeedDataSource just fills and returns a datatable with the following columns:

    dataTableSearchResults.Columns.Add("recipeId", typeof(string)); 
    dataTableSearchResults.Columns.Add("ingredientsIds", typeof(string)); 
    dataTableSearchResults.Columns.Add("country", typeof(string)); 
    dataTableSearchResults.Columns.Add("author", typeof(string)); 
    dataTableSearchResults.Columns.Add("style", typeof(string)); 
    dataTableSearchResults.Columns.Add("friendly", typeof(string)); 
    dataTableSearchResults.Columns.Add("name", typeof(string)); 


Once the RadGrid is databound, I run the following:

    var expression = GridGroupByExpression.Parse( 
    "recipeId [Recipe], count(recipeId) ingredientsIds [Ingredients]
    Group By recipeId"); 
    this.RadGridSearchResults.MasterTableView.GroupByExpressions.Add(expression); 
    this.RadGridSearchResults.GroupingEnabled = true; 

I would expect my radgrid to then look like the one they have here once you click on the 'Group by expression' button:

Instead, it looks like this:

After Load

Only looking right after I click the 'sort' button:

After Clicking Sort

Any clue? I even tried invoking sort manually but that was not successful.
Pavlina
Telerik team
 answered on 10 Aug 2009
6 answers
605 views
Hi there:

I have a RadGrid with 2 simple columns: one is BOUND and the other one is TEMPLATED.  Inside the Templated column, I have a label control.

Say, I want to change the backgound color of the BOUND control (different colors for different rows. Let's say, red, yellow, green and recycle them) and I want to change the innerHTML of the label control inside the Templated column to something different every row (say, A, B, C and recycle them). 

Furthermore, I want to achieve this using ClientEvents OnRowCreated. How can I achieve that? 

Of course, I know that the above can be easily done with server-side codes, however, I'm just learning how to use this new control and I want to understand the capacity of the OnRowCreated client event and I seem not to be able to find any document that explains how I can achieve the above-mentioned effect using OnRowCreated. . .

Thanks for you help!

Justin
Georgi Krustev
Telerik team
 answered on 10 Aug 2009
Narrow your results
Selected tags
Tags
+? more
Top users last month
Tien
Top achievements
Rank 1
Iron
Krasimir
Top achievements
Rank 3
Bronze
Iron
Iron
Cedar
Top achievements
Rank 1
Iron
Emil
Top achievements
Rank 1
Iron
Kyle Watson
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Tien
Top achievements
Rank 1
Iron
Krasimir
Top achievements
Rank 3
Bronze
Iron
Iron
Cedar
Top achievements
Rank 1
Iron
Emil
Top achievements
Rank 1
Iron
Kyle Watson
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?