Telerik Forums
UI for ASP.NET AJAX Forum
1 answer
196 views
Hi,
I've 3 levels hierarchy. all read from the same table as follow:

ID    RefID    ScheduleNo    CustPO    FabricIDSKU     MarkerID
1     Null        101                CO1            F1                    Null
2     Null        101                CO1            F2                    Null
3     Null        102                CO2            F1                    Null
4     Null        102                CO2            F2                    Null


I got the main Schedule from the table in level 1 where RefID IS NULL
Result:
Schedule
+ 101
+ 102

When expand the second level list all FabricIDSKU to be: where level2.ScheduleNo=Level1.ScheduleNo
Result:
    ID    RefID    ScheduleNo    FabricIDSKU    MarkerID
+ 1      null       101                 F1                    Null
+ 2      null       101                 F2                    Null


At this level I've inserted a select link, when i click i call a stored procedure from (RadGrid3_SelectedIndexChanged) and pass the "ID" of the selected item (example = 1), this procedure copy the same recored with new ID and in RefID "1" will be inserted.


Result:
    ID    RefID    Schedule    FabricIDSKU    MarkerID
    5       1             101            F1                    Null

then goto the third level and update the markerID. where Level3.RefID=parent (level2.ID)

I've two problems:
1- Level1 and level2 are expanding okay but i'm not able to expand level three.
2- After I've copy the recoerd through the stored procedure I run

 

Me.Marker_DS.DataBind()   
Me.RadGrid3.DataBind()  

 

 

 

After that the grid Collapse only level1 are displayed.

 

 

 

Code:
=====

 

<radG:RadGrid ID="RadGrid3" runat="server" AllowAutomaticDeletes="True" AllowAutomaticUpdates="True" AllowPaging="True" AllowSorting="True" AutoGenerateColumns="False" DataSourceID="Schedules_DS" GridLines="None" Height="100%" Skin="Office2007" Width="100%" AllowFilteringByColumn="True" EnableAJAX="True">   
<PagerStyle Mode="NumericPages" />   
<MasterTableView AllowMultiColumnSorting="True" DataKeyNames="ScheduleNo" DataSourceID="Schedules_DS" Width="100%">   
<DetailTables>    
<radG:GridTableView runat="server" Caption="&lt;&lt;&lt;--- S C H E D U L E . . . . I T E M S ---&gt;&gt;&gt;" DataKeyNames="ID,ScheduleNo" DataSourceID="FabricSKU_DS" Width="100%">   
<ParentTableRelation>   
<radG:GridRelationFields DetailKeyField="ScheduleNo" MasterKeyField="ScheduleNo" /> </ParentTableRelation>   
<DetailTables>   
<radG:GridTableView runat="server" Caption="&lt;&lt;&lt;--- M A R K E R S . . . . D E T A I L S ---&gt;&gt;&gt;" DataKeyNames="RefID" DataSourceID="Marker_DS" Width="100%">   
<ParentTableRelation>   
<radG:GridRelationFields DetailKeyField="RefID" MasterKeyField="ID" /> </ParentTableRelation>  

 

 

 

DataSource are:
=============

<asp:SqlDataSource ID="Schedules_DS" runat="server" ConnectionString="<%$ ConnectionStrings:BMSPTConnS %>"   
SelectCommand="SELECT ScheduleNo, Date, CustPO FROM dbo.MarkerDetails GROUP BY RefID, ScheduleNo, TIEPO, CustPO HAVING (RefID IS NULL)"</asp:SqlDataSource> 
 
<asp:SqlDataSource ID="FabricSKU_DS" runat="server" ConnectionString="<%$ ConnectionStrings:BMSPTConnS %>"   
SelectCommand="SELECT ScheduleNo, Style, StyleName, ColorName, ID, FabricIDSKU FROM dbo.MarkerDetails WHERE (RefID IS NULL AND ScheduleNo=@ScheduleNo)">   
<SelectParameters>   
    <asp:SessionParameter Name="ScheduleNo" SessionField="ScheduleNo" Type="String" />   
</SelectParameters>   
</asp:SqlDataSource>   
 
<asp:SqlDataSource ID="Marker_DS" runat="server" ConnectionString="<%$ ConnectionStrings:BMSPTConnS %>"   
OldValuesParameterFormatString="original_{0}"   
SelectCommand="SELECT [ID],[RefID],[MarkerID],[ScheduleNo],[MOQty],[Style],[StyleName],[ColorName],[FabricIDSKU],[FabricWidth],[MarkerLength] FROM [MarkerDetails] WHERE [ScheduleNo] =@ScheduleNo"   
UpdateCommand="UPDATE MarkerDetails SET [MarkerID] = @MarkerID,[FabricWidth]=@FabricWidth,[MarkerLength]=@MarkerLength,[Layers]=@Layers WHERE ID = @original_ID">   
<SelectParameters>   
<asp:SessionParameter Name="ScheduleNo" SessionField="ScheduleNo" Type="decimal" />   
<asp:SessionParameter Name="ID" SessionField="ID" Type="decimal" />   
</SelectParameters>   
<UpdateParameters>   
<asp:Parameter Name="MarkerID" />   
<asp:Parameter Name="FabricWidth" />   
<asp:Parameter Name="MarkerLength" />   
<asp:Parameter Name="Layers" />   
<asp:Parameter Name="original_ID"/>   
</UpdateParameters>  

 

 

 

 

Code Behind:
===========

 

Protected Sub RadGrid3_SelectedIndexChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles RadGrid3.SelectedIndexChanged   
Dim OldDbCon As String = ConfigurationManager.ConnectionStrings("BMSPTConnS").ConnectionString   
Dim dbCon As SqlConnection   
dbCon = New SqlConnection(OldDbCon)   
Try   
Dim Command As New SqlClient.SqlCommand("usp_InsertMarkerDetails", dbCon)   
Command.CommandType = CommandType.StoredProcedure  
Dim parameterID As New SqlParameter("@ID", SqlDbType.BigInt, 11)   
parameterID.Value = RadGrid3.SelectedValue   
Command.Parameters.Add(parameterID)  
dbCon.Open()  
Command.ExecuteNonQuery()  
dbCon.Close()  
Me.Marker_DS.DataBind()   
Me.RadGrid3.DataBind()   
Finally   
dbCon.Dispose()   
End Try   
End Sub  

  

 

Any help will be appreciated.
Mohamed 

Georgi Krustev
Telerik team
 answered on 02 Jun 2009
1 answer
119 views
I am unable to validate JavaScript Events before navingating to server side click event.

For instance I have 5 Tabs , I need to Check a condition client side, before posting back. If the condition is not satisfied I need to avoid post back of the page. But I am unable to validate such Javascript method.

I tried using  the below code on client side, but it not stopping the postback
============================================================

function

 

OnClientTabSelecting(sender,args)

 

{

 

var newTabValue = args.get_tab().get_value();

 

 

var oldTabValue = sender.get_selectedTab().get_value();

 

document.getElementById(

'<%=hdnCurrentTabid.ClientID%>').value=oldTabValue;

 

 

 

return false;
}

===============================================================
Please Help me out soon on this. I really struck up wit this :(.



--Srinath
Shinu
Top achievements
Rank 2
 answered on 02 Jun 2009
0 answers
80 views
I'm in the process of converting a VB.NET Class Library to C#. So far so good, except for the RadGrid events on the custom grid. In VB, I simply had the following:

Private Sub Me_ItemDataBound(ByVal sender As Object, ByVal e As Telerik.Web.UI.GridItemEventArgs) Handles Me.ItemDataBound
        '  Do stuff here
End If

in C#:

        protected void Me_ItemDataBound(object sender, Telerik.Web.UI.GridItemEventArgs e)
        {
            // Do stuff here
        }

In the C# version, the events never get fired. What am I missing?

Thanks,
Adam

Update:

Just had to hook-up the events in the constructor... for anyone else who has this question...

public Grid()
{
     this.ItemDataBound += MeItemDataBound;
}
Adam
Top achievements
Rank 1
 asked on 02 Jun 2009
4 answers
176 views
Hi,

I've got a little problem with RadComboBox. Actually when i set it to disable and i try to highlight the control it cause me a javascript error. I set the value directly in my usercontrol.ascx. 

var d=a.getClientRects(); it say that the method is undefined.

Thanks and have a nice day!

Guillaume

guillaume.lebel
Top achievements
Rank 1
Iron
Iron
 answered on 02 Jun 2009
1 answer
63 views
Hello Telerik Team,

 Suppose I have an appointment that is from 11:30 pm to 1 am. Now since this appointment spans 2 "days" in my Day View, there is an arrow which indicates so and clicking on that takes one to the next day. But my issue is that it doesnt focus on that very appointment for the next day. So my question is that whether this is feasible - to set focus on that very appointment on which user clicked through the downward arrow.

Regards,
Abhishek
Yana
Telerik team
 answered on 02 Jun 2009
1 answer
140 views
Hi,

I am using RadEditorMOSS in my MOSS Farm Env. I have deployed RadEditorMOSS.wsp and made all required web.config changes. I am able to see features on the site and activated the same. But i am facing following issues.

1. List items not showing telerik editor (whenever we add multiline richtext box as column to list it should show telerik editor)


2. I am able to see Telerik Editor for MOSS in Web Part list and when i add it and type in contents it saves the contents but it is not shving formatting that i applied for contents.

3. Is there any way to rename telerik editor for MOSS web part to something else in Web part list (not renaming web part title after adding on page)

Appreciate your quick help.


Best Regards,
Shekhar Kulkarni
Mobile: +358-40-360-0665

Stanimir
Telerik team
 answered on 02 Jun 2009
2 answers
231 views
Hi All,

I am trying to disabled selection for some rows base on my condition. I can successfully disabled the checkbox column. But when i click the row, i got the row.Index is underfined in function Selecting(row). Here is my code. Please let me know how can i get the row index to compare with my disabled index.

Thanks,
Alex

<

 

ClientSettings>

 

 

<Selecting AllowRowSelect="True" />

 

 

<ClientEvents OnRowSelecting="Selecting" />

 

 

</ClientSettings>

<script type="text/javascript"
    var a = Array; 
    window.onload = function () 
    { 
        var inp = document.getElementById('Sel'); 
        var data = inp.value; 
        if(data != ""
        { 
            var rowsData = data.split(":"); 
            var i=0; 
            while(typeof(rowsData[i]) != "undefined"
            { 
                if (rowsData[i] != ""
                { 
                    a[i] = rowsData[i]; 
                } 
                i++; 
            } 
        } 
    }     
    function Selecting (row)  
    { 
        var i = 0; 
        while(typeof(a[i]) != "undefined"
        { 
            if (a[i++] == row.Index) 
            { 
                return false
            } 
        } 
    } 
    </script> 

 

Alex
Top achievements
Rank 1
 answered on 02 Jun 2009
3 answers
78 views

I have set the grid PagerStyle mode='Slider". When dragging the knob, the page number is not displayed on the text (Page n of m). When I release the knob (stop dragging), it displays the current page.

This is happening with v2009.1.402.35. If I just replace the DLL with version 2009.1.311.35 it works. This is happening on IE8 and FF.

Regards,

Teo

Dimo
Telerik team
 answered on 02 Jun 2009
2 answers
127 views

How can I allow-disallow certain filters (including custom filter) to work or not to work while getting HTML content and design content?

Basically while doing get_html to get html for saving I want to execute following filter

1.      My Custom Filter1

2.      OptimizeSpans

3.      ConvertToXhtml

4.      IECleanAnchors

And while switching to html mode by my custom tool using set_mode command I want to execute only IndentHTMLContent filter.

 

How can I achieve this? Is there any way to execute the filters, changes the sequence in which filter executes and all from JavaScript?

 

Rumen
Telerik team
 answered on 02 Jun 2009
1 answer
183 views
Hello Sir / madam


             i have 2 form i m clicking on button open Radwindow with form in that radwindow one button it will open another Radwindow inside Radwindow ... but i want to automatically Resize the Parent window ? How to achieve ? Urgent !!!!!!!!!!!!!!!!!!!1


Thanks
Regards
Rahul M
Shinu
Top achievements
Rank 2
 answered on 02 Jun 2009
Narrow your results
Selected tags
Tags
+? more
Top users last month
Simon
Top achievements
Rank 2
Iron
Iron
Iron
Bob
Top achievements
Rank 3
Iron
Iron
Veteran
Marco
Top achievements
Rank 4
Iron
Iron
Iron
Grant
Top achievements
Rank 3
Iron
Iron
Iron
Kao Hung
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Simon
Top achievements
Rank 2
Iron
Iron
Iron
Bob
Top achievements
Rank 3
Iron
Iron
Veteran
Marco
Top achievements
Rank 4
Iron
Iron
Iron
Grant
Top achievements
Rank 3
Iron
Iron
Iron
Kao Hung
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?