Telerik Forums
UI for ASP.NET AJAX Forum
3 answers
163 views

Hello,

I have a quick question;

I use the following method to expand and collapse grid rows (client side) when I have a hierarchical grid;

*****************************************
var RadGrid1 = $find("<%= RadGrid1.ClientID %>");
for (var i = 0; i < RadGrid1.get_masterTableView().get_dataItems().length; i++) {
 var item = RadGrid1.get_masterTableView().get_dataItems()[i];
 var MasterTable = RadGrid1.get_masterTableView();
 var row = RadGrid1.get_masterTableView().get_dataItems()[i];
 var cell = MasterTable.getCellByColumnUniqueName(row, "ExpandColumn");

 if (cell.innerHTML != "") {
     if (gridExpanded == false) {
  item.set_expanded(true);
  gridChanged2 = true;
     }
     else {
  item.set_expanded(false);
  gridChanged2 = false;
     }
 }
}
gridExpanded = gridChanged2;
*****************************************

But now I need to expand and collapse a rid that is setup with Groups or "GroupBy" with GroupHeaders via client side code and I can't seem to find the proper object / property to make it work.

Can you please point me in the right direction? How do I expand and collapse a grid with client side code that is grouped?

Many thanks in advance,

Dave

Dave Navarro
Top achievements
Rank 2
 answered on 09 Dec 2008
2 answers
106 views
I have created the following code to make three radgrids visible and invisible by clicking three options on radToolBar...
I have called the following function on toolBarItemClicked event, but only the first radgrid is working accordingly while pthers arent. Please help!

function

OnMainMenuItemClick(sender, args) // fine

 

{

 

var itemText = args.get_item();

 

 

if(itemText.get_text() == "NoteBook")

 

{

$find(

"<%= RadGrid_NoteBook.ClientID %>").get_element().style.display = "";

 

$find(

"<%= RadGrid_Networks.ClientID %>").get_element().style.display = "none";

 

$find(

"<%= RadGrid_Friends.ClientID %>").get_element().style.display = "none";

 

}

 

else if(itemText.get_text() == "Networks")

 

{

$find(

"<%= RadGrid_NoteBook.ClientID %>").get_element().style.display = "none";

 

$find(

"<%= RadGrid_Friends.ClientID %>").get_element().style.display = "none";

 

$find(

"<%= RadGrid_Networks.ClientID %>").get_element().style.display = "";

 

}

 

else if(itemText.get_text() == "Friends")

 

{

$find(

"<%= RadGrid_NoteBook.ClientID %>").get_element().style.display = "none";

 

$find(

"<%= RadGrid_Networks.ClientID %>").get_element().style.display = "none";

 

$find(

"<%= RadGrid_Friends.ClientID %>").get_element().style.display = "";

 

}

}

Saad
Top achievements
Rank 1
 answered on 09 Dec 2008
4 answers
115 views
I checked out the tutorial at this url:  http://blogs.telerik.com/VladimirEnchev/Posts/08-11-12/REST_Service_Calls_with_grid_client_binding.aspx?ReturnURL=%2fVladimirEnchev%2fPosts.aspx

Nice article, one question though, if I get zero hits and use the set_virtualItemCount(0) the grid does not show that there are zero hits, do I maybey need to call an update or refresh method on the grid?

Thanks
Nikolay Rusev
Telerik team
 answered on 09 Dec 2008
4 answers
236 views
Hello,

I have a UserControl with a standalone ImageManager. The userControl is loaded into an aspx page which references a nested masterpage. (with me so far?). What I would like is to move the code from the ascx code behind into the aspx code behind. I have tried every location I can think of in both the aspx page and the masterpage - I always end up with error: "Dialog Parameters for ImageManager Dialog do not exist".

The code currently in Page_load of user control (which works):


Dim
imageManager_parameters As New Editor.DialogControls.FileManagerDialogParameters

Dim imagePath As String() = {"~/App_Themes/images"}

With imageManager_parameters

            .ViewPaths = imagePath

            .SearchPatterns = New String() {"*.jpg"}

            .MaxUploadFileSize = 5000000

End With

 

Dim imageManager_dialogDefinition As New DialogDefinition(GetType(Editor.DialogControls.ImageManagerDialog), imageManager_parameters)

With imageManager_dialogDefinition

            .ClientCallbackFunction = "set_Image"

            .Width = Unit.Pixel(694)

            .Height = Unit.Pixel(440)

End With

 

telerik_imageManager.DialogDefinitions.Add("ImageManager", imageManager_dialogDefinition)


The user control is added to the Init of the aspx page.  
any suggestions?
thank you in advance for any assistance!

- kelly williams

 

 

 

 

 

 

 

 

 

 

 

 

Lana
Top achievements
Rank 1
 answered on 09 Dec 2008
3 answers
166 views
Hi,

One of my page contains an asp:repeater and a radgrid. I want to drag-drop items from repeater to radgrid.

Is there any way for that?

regards ...
Crescent
Top achievements
Rank 1
 answered on 09 Dec 2008
1 answer
130 views

I am trying to code an upload page that does the following:

  1. User selects up to 5 files to upload
  2. Once they click submit, behind code validates that none of the (1 to 5) uploaded files does not already exsist.

        a. If they do, then an error message stating which file is a duplicate is displayed to the user on the postback.
        b. If all files (1 to 5) do not exist, then they are saved to server, the SQL table is updated with the new file names, locations, etc.

I have the upload section working well as well as the writing the new file information to the correct table but I cannot get the file exists check code to work properly.

Here's what I have...

Imports Telerik.Web.UI     
Imports System.IO     
Imports System.Data.SqlClient     
Imports Telerik.Web.UI.Upload     
    
Protected Sub RadUpload1_FileExists(ByVal sender As ObjectByVal e As UploadedFileEventArgs) Handles RadUpload1.FileExists     
        Dim file As UploadedFile = e.UploadedFile  
        'Session("UserDir") comes from other working code   
        Dim targetFolder As String = Session("UserDir")     
        Dim targetFileName As String = System.IO.Path.Combine(targetFolder, file.GetExtension)     
          
        While System.IO.File.Exists(targetFileName)     
            'Sets error label to visable and displays message.     
            lblUploadError.Visible = True    
            lblUploadError.Text = "File name already exists!"    
        End While    
End Sub    
 
Protected Sub SubmitButton_Click(ByVal sender As ObjectByVal e As System.EventArgs) Handles SubmitButton.Click     
   
        If RadUpload1.UploadedFiles.Count > 0 Then    
            System.Threading.Thread.Sleep(3000)     
        End If    
    
        For Each f As UploadedFile In RadUpload1.UploadedFiles     
            f.SaveAs(Session("UserDir") & f.GetName, False)     
    
            ' Insert a new record into Call_Info table     
    
            'Set Active Date on new user to today     
            Dim UploadDate As DateTime = DateTime.Now     
    
            Dim connectionString As String = ConfigurationManager.ConnectionStrings("eonPortalCS").ConnectionString     
            Dim insertSql As String = "INSERT INTO Call_Info(UserId, File_Name, File_Location, Discipline, Call_Status, Upload_Date, Uploaded_By) VALUES(@UserId, @FileName, @FileLocation, @Discipline, @CallStatus, @UploadDate, @UploadedBy)"    
            Dim myConnection As New System.Data.SqlClient.SqlConnection(connectionString)     
            Dim myCommand As New System.Data.SqlClient.SqlCommand(insertSql, myConnection)     
              
                Using myConnection     
                myConnection.Open()     
                myCommand.Parameters.AddWithValue("@UserId", Session("UploadUserID"))     
                myCommand.Parameters.AddWithValue("@FileName", f.GetName)     
                myCommand.Parameters.AddWithValue("@FileLocation", Session("UserDir"))     
                myCommand.Parameters.AddWithValue("@Discipline", Session("UserDiscipline"))     
                myCommand.Parameters.AddWithValue("@CallStatus""New")     
                myCommand.Parameters.AddWithValue("@UploadDate", UploadDate)     
                myCommand.Parameters.AddWithValue("@UploadedBy", Session("CurrentUserGuid"))     
                myCommand.ExecuteNonQuery()     
                myConnection.Close()     
            End Using     
        Next    
        RadUpload1.Enabled = False    
        SubmitButton.Enabled = False    
        Session("UploadUserID") = ""    
    End Sub    
 

Any suggestions?

Thanks,
Joe

Joe
Top achievements
Rank 2
 answered on 09 Dec 2008
4 answers
154 views
Hi everyone,
    Can anyone help me with this:

My RadTimePicker is inside a user control that is used to edit a RadGrid.
When i click in the grid to go into edit mode, i have this error message:

Provided DataSource for timeView is not supported

Telerik.Web.UI.dll - RadTimeView.DataBind System.Web.dll - Control.DataBindChildren System.Web.dll - Control.DataBind System.Web.dll - Control.DataBind System.Web.dll - Control.DataBindChildren System.Web.dll - Control.DataBind System.Web.dll - Control.DataBind System.Web.dll - Control.DataBindChildren System.Web.dll - Control.DataBind System.Web.dll - Control.DataBind System.Web.dll - Control.DataBindChildren System.Web.dll - Control.DataBind System.Web.dll - Control.DataBind System.Web.dll - Control.DataBindChildren System.Web.dll - Control.DataBind System.Web.dll - Control.DataBind Telerik.Web.UI.dll - GridEditFormItem.SetupItem Telerik.Web.UI.dll - GridItemBuilder.CreateItems Telerik.Web.UI.dll - GridTableView.CreateItems Telerik.Web.UI.dll - GridTableView.CreateControlHierarchy Telerik.Web.UI.dll - GridTableView.CreateChildControls System.Web.dll - CompositeDataBoundControl.PerformDataBinding System.Web.dll - DataBoundControl.OnDataSourceViewSelectCallback System.Web.dll - DataSourceView.Select System.Web.dll - DataBoundControl.PerformSelect Telerik.Web.UI.dll - GridTableView.PerformSelect System.Web.dll - BaseDataBoundControl.DataBind Telerik.Web.UI.dll - GridTableView.DataBind Telerik.Web.UI.dll - GridTableView.Rebind Telerik.Web.UI.dll - GridCommandEventArgs.ExecuteCommand Telerik.Web.UI.dll - RadGrid.OnBubbleEvent System.Web.dll - Control.RaiseBubbleEvent Telerik.Web.UI.dll - GridItem.OnBubbleEvent System.Web.dll - Control.RaiseBubbleEvent System.Web.dll - ImageButton.OnCommand System.Web.dll - ImageButton.RaisePostBackEvent System.Web.dll - ImageButton.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent System.Web.dll - Page.RaisePostBackEvent System.Web.dll - Page.RaisePostBackEvent System.Web.dll - Page.ProcessRequestMain

<Telerik:TimePicker ID="txtPlannedDuration" runat="server" Culture="French (Canada)" 
                Style="width: 58px; " TabIndex="322">  
                <TimePopupButton CssClass="" ImageUrl="" HoverImageUrl=""></TimePopupButton> 
                <TimeView runat="server" CellSpacing="-1" Culture="French (Canada)" 
                    Interval="00:30:00" Column="5">  
                </TimeView> 
                <DateInput Width="" LabelCssClass="">  
                </DateInput> 
                <Calendar UseRowHeadersAsSelectors="False" UseColumnHeadersAsSelectors="False" ViewSelectorText="x">  
                </Calendar> 
                <DatePopupButton Visible="False" CssClass="" ImageUrl="" HoverImageUrl=""></DatePopupButton> 
            </Telerik:TimePicker> 
Alexandre
Top achievements
Rank 1
 answered on 09 Dec 2008
1 answer
94 views
Here is a sample of what i want to do via the rotator
http://www.sothink.com/product/javascriptwebscroller/samples/cellphone/cellphone.htm


What i need is the arrows but instead of looping  to stop at the end of a recordset, im going to pass values by stored procedure.
Georgi Tunev
Telerik team
 answered on 09 Dec 2008
2 answers
155 views
I have created a GridBoundColumn which is connected with a datetime field in the underlying database.
What is the purpose of 'between' in the filtering button since the user can enter only one date?
Thank you very much.
Daniel
Telerik team
 answered on 09 Dec 2008
2 answers
167 views
I'm migrating from Q2 2007 version to Q3 2008.

I have the following code:

<asp:Panel ID="toolBarPanel" runat="server"
    <radTlb:RadToolbar ID="toolBar" runat="server" UseFadeEffect="True" Skin="Mac" ButtonHeight="24px" 
        ButtonWidth="24px" AutoPostBack="true" CatalogIconImageUrl="" SkinsPath="~/RadControls/Toolbar/Skins" 
        ImagesDir="~/Imagenes/" OnOnClick="toolBar_OnClick" OnPreRender="toolBar_PreRender" 
        ValidationGroup="GV1" > 
        <Items> 
            <radTlb:RadToolbarButton ID="button1" ButtonImage="image1.png" CommandName="CMD1" 
                runat="server" ButtonText="CMD1" Hidden="False" CausesValidation="false" /> 
            <radTlb:RadToolbarButton ID="button2" ButtonImage="image2.png" CommandName="CMD2" 
                runat="server" ButtonText="CMD2" Hidden="False" CausesValidation="false" /> 
        </Items> 
    </radTlb:RadToolbar> 
 
    <script type="text/javascript"
<!-- 
<%= toolBar.ClientID %>.attachEvent("OnClientClick","click_handler"); 
function click_handler(sender, e) 
    if (sender.CommandName=='DELETE') { 
        return confirm('<%= MissatgeDinamic("Del1") %>'); 
    } 
--> 
    </script> 
</asp:Panel> 

and now I have translated it to the following one.

<asp:Panel ID="toolBarPanel" runat="server"
    <telerik:RadToolBar ID="toolBar" runat="server" UseFadeEffect="True" Skin="Gray" ButtonHeight="24px" 
        ButtonWidth="24px" AutoPostBack="true" OnButtonClick="toolBar_OnButtonClick" OnPreRender="toolBar_PreRender" 
        ValidationGroup="GV1" > 
        <Items> 
            <telerik:RadToolbarButton ID="button1" ImageUrl="~/Imagenes/image1.png" CommandName="CM1" 
                runat="server" ButtonText="CMD1" Hidden="False" CausesValidation="false" /> 
            <telerik:RadToolbarButton ID="button2" ImageUrl="~/Imagenes/image2.png" CommandName="CM2" 
                runat="server" ButtonText="CMD2" Hidden="False" CausesValidation="false" /> 
        </Items> 
    </telerik:RadToolBar> 
    <telerik:RadCodeBlock ID="RadCodeBlock1" runat="server"
      <script type="text/javascript"
        $find("<%= toolBar.ClientID %>").attachEvent("OnClientClick","click_handler"); 
        function click_handler(sender, e) 
        { 
            if (sender.CommandName=='DELETE') { 
                return confirm('<%= MissatgeDinamic("Del1") %>'); 
            } 
        } 
      </script> 
    </telerik:RadCodeBlock> 
</asp:Panel> 

When I execute this appears a Visual Studio 2008 pop-up window with the message (I translate from Spanish) Microsoft JScript error at execution time: 'null' is null or not is an object, and the generated code I can see is:

<div id="toolBar" class="RadToolBar RadToolBar_Horizontal RadToolBar_Gray RadToolBar_Gray_Horizontal " UseFadeEffect="True" ButtonHeight="24px" ButtonWidth="24px" style="z-index:9000;"
<div class="rtbOuter"
    <div class="rtbMiddle"
        <div class="rtbInner"
            <ul class="rtbUL"
                <li class="rtbItem rtbBtn"><class="rtbWrap" ID="button1" href="#"><span class="rtbOut"><span class="rtbMid"><span class="rtbIn"><img alt="" src="Imagenes/image1.png" class="rtbIcon" /></span></span></span></a></li><li class="rtbItem rtbBtn"><class="rtbWrap" ID="button2" href="#"><span class="rtbOut"><span class="rtbMid"><span class="rtbIn"><img alt="" src="Imagenes/image2.png" class="rtbIcon" /></span></span></span></a></li
            </ul> 
        </div> 
    </div> 
</div><input id="toolBar_ClientState" name="toolBar_ClientState" type="hidden" /> 
</div> 
 
    <script type="text/javascript"
$find("toolBar").attachEvent("OnClientClick","click_handler"); 
function click_handler(sender, e) 
    if (sender.CommandName=='DELETE') { 
        return confirm('¿Seguro de borrar este elemento?'); 
    } 
    < 

What is happening here? Any solution for this?




Jesús
Top achievements
Rank 1
 answered on 09 Dec 2008
Narrow your results
Selected tags
Tags
+? more
Top users last month
Shiori
Top achievements
Rank 2
Iron
Tien
Top achievements
Rank 1
Iron
Robert
Top achievements
Rank 1
Rob
Top achievements
Rank 4
Bronze
Bronze
Iron
Geoff
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Top users last month
Shiori
Top achievements
Rank 2
Iron
Tien
Top achievements
Rank 1
Iron
Robert
Top achievements
Rank 1
Rob
Top achievements
Rank 4
Bronze
Bronze
Iron
Geoff
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?