Telerik Forums
UI for ASP.NET AJAX Forum
1 answer
142 views
I have an radcombobox with an autosuggest,
If no suggestions are found, than the dropdown with the suggestions doesn't close.
Is there anyway to do this?
Shinu
Top achievements
Rank 2
 answered on 24 Dec 2009
1 answer
699 views

Since I'm not familiar with everything RadGrid and RadWindow can do, I'm wondering if I'm re-inventing the wheel and these controls already do some of this, or something similar.

I have some pretty static data I don't want to query often to save trips. So I thought I'd have the Cache hold the data until 20 minutes after it's no longer requested. (It seems to work, but I've never used the Cache before, so I'm not sure of the pros and cons.) Anyway, I have a RadGrid on an aspx page. Below is the example code behind against the Northwind DB. The aspx page is referenced by a RadWindow that makes it popup modally.

Like I said, I'm wondering if I'm doing more than necessary, or if I'm doing some bad/inefficient coding in regard to your controls, or even in general. Thanks for any input you can give.


Imports System.Data  
 
Partial Class MyRadGrid  
    Inherits System.Web.UI.Page  
 
    Protected Sub RadGrid1_NeedDataSource(ByVal source As Object, ByVal e As Telerik.Web.UI.GridNeedDataSourceEventArgs) Handles RadGrid1.NeedDataSource  
 
        Dim strSQL As String 
        strSQL = "SELECT SupplierID, ContactName, City, Region, PostalCode, Country FROM Suppliers" 
 
        Dim strCacheName As String = "SupplierData" 
        Dim ds As DataSet = CType(Cache(strCacheName), DataSet)  
 
        If ds Is Nothing Then 
            Dim aDB As New AccessDataSource("~/App_Data/Northwind.mdb", strSQL)  
            Dim mydv As System.Data.DataView = CType(aDB.Select(DataSourceSelectArguments.Empty), System.Data.DataView)  
            Dim dt As DataTable = mydv.ToTable  
            ds = New DataSet  
            ds.Tables.Add(dt)  
            Cache.Insert(strCacheName, ds, Nothing, Cache.NoAbsoluteExpiration, New System.TimeSpan(0, 0, 20))  
        End If 
 
        RadGrid1.DataSource = ds  
 
    End Sub 
 
End Class 
 
Princy
Top achievements
Rank 2
 answered on 24 Dec 2009
1 answer
83 views

I've placed a grid into a RadWindow. It looks great and I love the functionality. However, If I do a filter and the resulting data is small (say only 2 rows) then when I click on the filter again, the filter options are cut off inside the window. It prevents me from turning the filter off or looking at other options, forcing me to close the window. I assume there's a way around this?

Princy
Top achievements
Rank 2
 answered on 24 Dec 2009
0 answers
126 views
This post was removed.
Giang Dinh
Top achievements
Rank 1
 asked on 24 Dec 2009
2 answers
170 views
I am getting the following error when I deploy my application to our webserver.  I have Telerik version 2009.3 1103.  How do I resolve this issue?

Description: An error occurred during the processing of a configuration file required to service this request. Please review the specific error details below and modify your configuration file appropriately.

Parser Error Message: Could not load file or assembly 'Telerik.Web.UI' or one of its dependencies. The system cannot find the file specified. (C:\Inetpub\wwwroot\TestApp\web.config line 113)

Source Error:

Line 111:		<httpModules>
Line 112:			<add name="ScriptModule" type="System.Web.Handlers.ScriptModule, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
Line 113:			<add name="RadUploadModule" type="Telerik.Web.UI.RadUploadHttpModule, Telerik.Web.UI" />
Line 114:			<add name="RadCompression" type="Telerik.Web.UI.RadCompression" />
Line 115:		</httpModules>

Source File: C:\Inetpub\wwwroot\TestApp\web.config    Line: 113


Daniel
Telerik team
 answered on 23 Dec 2009
1 answer
111 views
I have a RadComboBox that has a RadTreeView.  I would like to make the field required and am having a little trouble putting it together in my head.  I need to make sure that a non-root level node is selected in the tree.  Anyone have any advice on how to accomplish this?  I thinking that a RequiredFieldValidator is out of the question and I'll probably need to go the CustomValidator route. 
Any help appreciated.


Here is my markup:
<telerik:RadComboBox ID="ProjectRadComboBox" AllowCustomText="True" EmptyMessage="[Choose One...]" 
    runat="server" Width="150px">  
    <ItemTemplate> 
        <div onclick="StopPropagation(event)">  
            <telerik:RadTreeView ID="ProjectRadTreeView" runat="server" DataTextField="project_name" 
                DataValueField="project_id" DataFieldID="project_id" DataFieldParentID="fk_precinct_id" 
                OnClientNodeClicking="OnClientNodeClickingHandler" OnNodeExpand="ProjectRadComboBox_NodeExpand" 
                Height="300px">  
            </telerik:RadTreeView> 
        </div> 
    </ItemTemplate> 
    <Items> 
        <telerik:RadComboBoxItem runat="server" Text="[Choose One...]" Value="[Choose One...]" Selected="True" /> 
    </Items> 
</telerik:RadComboBox> 

Gene
Top achievements
Rank 1
 answered on 23 Dec 2009
3 answers
132 views
Hello,

I am trying to create a grid with 2-level self referencing hierarchy. However, the client does not have direct access to the database; it can only request a dataset for a given key. Is there any way to do this without looping through and loading the entire table into the dataset?

This is my current code (TCDataSet is inherited from the DataSet object):
protected void loadGrid() 
    { 
        // Get the null level type codes
        TCDataSet typeCodeDataset = controller.GetTypeCode(null); 
        DataView typeCodeDataview = typeCodeDataset.typecode.DefaultView; 

         
        // Bind the RadGrid's top level view to the null level type codes 
        RadGrid1.MasterTableView.DataSource = typeCodeDataview; 
        RadGrid1.MasterTableView.DataKeyNames = new string[] { "type_code" }; 
        RadGrid1.MasterTableView.EnableColumnsViewState = false; 
 
        // Create datasets for sub level typecodes 
        TCDataSet[] subTypeCodes = new TCDataSet[typeCodeDataview.Count]; 
        DataView[] subTypeCodeViews = new DataView[typeCodeDataview.Count]; 
        GridTableView[] subTypeCodeTableViews = new GridTableView[typeCodeDataview.Count]; 
        for (int i = 0; i < typeCodeDataview.Count; i++) 
        { 
            subTypeCodes[i] = new TCDataSet(); 
            subTypeCodeViews[i] = subTypeCodes[i].typecode.DefaultView; 
            subTypeCodeTableViews[i] = new GridTableView(); 
            subTypeCodeTableViews[i].DataSource = subTypeCodeViews[i]; 
            subTypeCodeTableViews[i].DataKeyNames = new string[2] { "type_code", "type_value" }; 
            RadGrid1.MasterTableView.DetailTables.Insert(i, subTypeCodeTableViews[i]); 
            GridBoundColumn subColumn = new GridBoundColumn(); 
            RadGrid1.MasterTableView.DetailTables[i].Columns.Add(subColumn); 
            subColumn.DataField = "type_code"; 
            subColumn.HeaderText = "Type Code"; 
            subColumn.HeaderStyle.Width = 80; 
        } 
 
        //Column to use to create the RadGrid columns 
        GridBoundColumn boundColumn; 
 
        //type_code column 
        boundColumn = new GridBoundColumn(); 
        RadGrid1.MasterTableView.Columns.Add(boundColumn); 
        boundColumn.DataField = "type_code"; 
        boundColumn.HeaderText = "Type Code"; 
        boundColumn.HeaderStyle.Width = 80;//Unit.Pixel(20); 
 
        //type_value column 
        boundColumn = new GridBoundColumn(); 
        RadGrid1.MasterTableView.Columns.Add(boundColumn); 
        boundColumn.DataField = "type_value"; 
        boundColumn.HeaderText = "Type Value"; 
        boundColumn.HeaderStyle.Width = 80;// Unit.Pixel(30); 
 
        int gridWidth = 0; 
        for (int i = 0; i < RadGrid1.MasterTableView.Columns.Count; i++) 
        { 
            gridWidth += (int)RadGrid1.MasterTableView.Columns[i].HeaderStyle.Width.Value; 
        } 
        RadGrid1.Width = gridWidth + 30; 
    } 
 
 
    protected void RadGrid1_ItemCommand(object source, GridCommandEventArgs e) 
    { 
        int index = e.Item.ItemIndex; 
        subTypeCodes[index] = controller.GetTypeCode(typeCodeDataview[index]["type_value"].ToString()); 
        subTypeCodeViews[index] = subTypeCodes[index].typecode.DefaultView; 
        subTypeCodeTableViews[index].Rebind(); 
 
    } 

Basically what I'm trying to do here is create a dataset for every master row, and then populate it when the row is expanded. When I click the 'expand' button, the grid seems to disappear.
Josh
Top achievements
Rank 1
 answered on 23 Dec 2009
1 answer
168 views
I have one single page, in that all the application in terms of user control will get loaded dynamically. [By calling the LoadControl method]
On one controls I have some rad tab and their page view which also get loaded dynamically to the user control.
After clicking on one tab the images section comes up, where one can see the listing [ in  RadListView]
and can upload the images as well.
This is what I have done :
<telerik:RadUpload Localization-Select="Browse" ID="RadUpload" runat="server" ControlObjectsVisibility="AddButton"
                        MaxFileInputsCount="5" />
I am saving the images to database, but before that I had to disable the ajax, to post the file. For that I had to use this Line of code : StringBuilder js = new StringBuilder();
            js = js.Append("function conditionalPostback(sender, args){");
            js.Append("if (args.get_eventTarget() == '" + buttonSubmit.UniqueID + "') {alert('hi');");
            js.Append("args.set_enableAjax(false);}}");
            ScriptManager.RegisterClientScriptBlock(Page, typeof(Page), "UploadScript", js.ToString(), true);
       
I have tried the same js in the aspx page with the RadCodeBlock but its not working. Anyways the main problem is after uploading images first time the file input text area and the browse button got disappears, but the add and upload button remains there.
I have tried it very hard but of no luck...
Please help

Also i thought of another way to reload the whole control again after the post back that way the upload control should treat like it has come first time, but at that time after the postback, if I want to upload more images the RadUpload.UploadedFiles returns the count 0 [Seems like my js has not effected this time]

Please help

One more thing, I have missed above is this string "RadUrid=b086b64a-9a52-4bc3-8a63-5e7565d731ea " gets appended to my url, after the upload image action very first time. Im not sure what is this. And I want to get rid of this as well.[One minor item]. Please help, its urgent. [Client wants to look at this at the earliest ]

Thanks
Schlurk
Top achievements
Rank 2
 answered on 23 Dec 2009
5 answers
146 views
Greetings,

I'm currently in a bit of a pickle on a project.

I have a grid with the following columns:
DocID (bound column that is a string and display is false),
Type (a templated column that has an image in it),
DisplayName (bound column that is a string),
Owner (bound column that is an int that has display of false),
OwnerName (bound column that is a string),
ModifiedBy (bound column that is an int and has a display of false),
ModifiedByName (templated column with a label within it),
ModifiedDate (bound column with a datetime in it)

I sort on all columns, with exclusion of the ones with display hidden and Type.  The issue I'm having is with ModifiedByDate.  This column is populated with data during OnItemDataBound.  It is loaded based on the ModifiedBy field's value.  To populate it, I go to the database during OnItemDataBound and fill in the label that is within the column.

What I'm curious on is is there a way to sort this column?  Our Data Transfer Object (DTO) doesn't have a place in it for it, plus it's been deemed that it won't ever have one either.  So, my question is, how would I sort this field?  Thank you for any answers.

~Chad Johnson
Pavlina
Telerik team
 answered on 23 Dec 2009
2 answers
119 views
I apologize if I am overlooking something simple or just misunderstanding how this works but is there an easy way to retrieve a radgrid's filtered collection of data once the filtering has finished?  I would assume there would be a property of some sort I could grab and manipulate that had all of these items but I haven't found anything yet.

Could someone point me in the right direction on how I could get just the items filtered on a grid, once the filtering is finished on a server side post back.

Any help would be appreciated.

Thank you, 
Chris McMahan
Chris McMahan
Top achievements
Rank 1
 answered on 23 Dec 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?