Telerik Forums
UI for ASP.NET AJAX Forum
2 answers
96 views

hi

i want to create some check box and ,when user click on it's , dynamically create 3 filed(RadTextBox) for each them.

i create it  but when click on each them.only create one row and when click on other check box, previos row will be clear and new created.

i want each row create in one line and user can fill it's.

my code

...  
 
System.Web.UI.HtmlControls.HtmlTable tbl;  
 System.Web.UI.HtmlControls.HtmlTableRow row = new System.Web.UI.HtmlControls.HtmlTableRow();  
 System.Web.UI.HtmlControls.HtmlTableCell cell = new System.Web.UI.HtmlControls.HtmlTableCell();  
 protected void CheckBox1_CheckedChanged(object sender, EventArgs e)  
 {  
 if (CheckBox1.Checked == true)  
 {  
 tbl = new System.Web.UI.HtmlControls.HtmlTable();  
 tbl.ID = "tbl";  
 tbl.Width = "250px";  
 tbl.Border = 1;  
 row = new System.Web.UI.HtmlControls.HtmlTableRow();  
 //RadAjaxPanel2.Alert("text chnaged");  
 RadTextBox rtxtNewTextBox;  
 for (int i = 0; i < 3; ++i)  
 {  
 cell = new System.Web.UI.HtmlControls.HtmlTableCell();  
 if (i == 0)  
 {  
 rtxtNewTextBox = new RadTextBox();  
 rtxtNewTextBox.ID = "Txt" + (RadComboBox1.SelectedItem.Value).ToString() + RadComboBox1.SelectedItem.Text + i;  
 rtxtNewTextBox.Text = "check1";  
 rtxtNewTextBox.Label = ":" + RadComboBox1.SelectedItem.Text;  
 //rtxtNewTextBox.EmptyMessage = strMappedName;  
 //rtxtNewTextBox.Text = strMappedName;  
 cell.Controls.Add(rtxtNewTextBox);  
 
 }  
 if (i == 1)  
 {  
 rtxtNewTextBox = new RadTextBox();  
 rtxtNewTextBox.ID = "Txt" + (RadComboBox1.SelectedItem.Value).ToString() + RadComboBox1.SelectedItem.Text + i;  
 rtxtNewTextBox.Label = "درصد:";  
 //rtxtNewTextBox.EmptyMessage = strMappedName;  
 //rtxtNewTextBox.Text = strMappedName;  
 cell.Controls.Add(rtxtNewTextBox);  
 }  
 if (i == 2)  
 {  
 rtxtNewTextBox = new RadTextBox();  
 rtxtNewTextBox.ID = "Txt" + (RadComboBox1.SelectedItem.Value).ToString() + RadComboBox1.SelectedItem.Text + i;  
 rtxtNewTextBox.Label = "توضیحات:";  
 rtxtNewTextBox.Width = 200;  
 //rtxtNewTextBox.EmptyMessage = strMappedName;  
 //rtxtNewTextBox.Text = strMappedName;  
 cell.Controls.Add(rtxtNewTextBox);  
 }  
 
 
 row.Cells.Add(cell);  
 
 }  
 tbl.Rows.Add(row);  
 RadAjaxPanel2.Controls.Add(tbl);  
 //RadAjaxPanel2.Controls.AddAt(2, tbl);  
 
 
 }  
 }  
 
 protected void CheckBox2_CheckedChanged(object sender, EventArgs e)  
 {  
 if (CheckBox2.Checked == true)  
 {  
 //System.Web.UI.HtmlControls.HtmlTable tbl1;  
 tbl = new System.Web.UI.HtmlControls.HtmlTable();  
 //System.Web.UI.HtmlControls.HtmlTableRow row = new System.Web.UI.HtmlControls.HtmlTableRow();  
 //System.Web.UI.HtmlControls.HtmlTableCell cell = new System.Web.UI.HtmlControls.HtmlTableCell();  
 tbl.ID = "tbl1";  
 tbl.Width = "250px";  
 tbl.Border = 1;  
 row = new System.Web.UI.HtmlControls.HtmlTableRow();  
 //RadAjaxPanel2.Alert("text chnaged");  
 RadTextBox rtxtNewTextBox;  
 for (int i = 0; i < 3; ++i)  
 {  
 cell = new System.Web.UI.HtmlControls.HtmlTableCell();  
 if (i == 0)  
 {  
 rtxtNewTextBox = new RadTextBox();  
 rtxtNewTextBox.ID = "Txt" + (RadComboBox1.SelectedItem.Value).ToString() + RadComboBox1.SelectedItem.Text + i;  
 rtxtNewTextBox.Text = "check2";  
 rtxtNewTextBox.Label = ":" + RadComboBox1.SelectedItem.Text;  
 //rtxtNewTextBox.EmptyMessage = strMappedName;  
 //rtxtNewTextBox.Text = strMappedName;  
 cell.Controls.Add(rtxtNewTextBox);  
 }  
 if (i == 1)  
 {  
 rtxtNewTextBox = new RadTextBox();  
 rtxtNewTextBox.ID = "Txt" + (RadComboBox1.SelectedItem.Value).ToString() + RadComboBox1.SelectedItem.Text + i;  
 rtxtNewTextBox.Label = "درصد:";  
 //rtxtNewTextBox.EmptyMessage = strMappedName;  
 //rtxtNewTextBox.Text = strMappedName;  
 cell.Controls.Add(rtxtNewTextBox);  
 }  
 if (i == 2)  
 {  
 rtxtNewTextBox = new RadTextBox();  
 rtxtNewTextBox.ID = "Txt" + (RadComboBox1.SelectedItem.Value).ToString() + RadComboBox1.SelectedItem.Text + i;  
 rtxtNewTextBox.Label = "توضیحات:";  
 rtxtNewTextBox.Width = 200;  
 //rtxtNewTextBox.EmptyMessage = strMappedName;  
 //rtxtNewTextBox.Text = strMappedName;  
 cell.Controls.Add(rtxtNewTextBox);  
 }  
 
 
 row.Cells.Add(cell);  
 
 }  
 tbl.Rows.Add(row);  
 RadAjaxPanel2.Controls.Add(tbl);  
 //RadAjaxPanel1.Controls.AddAt(1, tbl);  
 
 
 
 
 }  
 
 
 
 } 

Mohammadreza reiazi
Top achievements
Rank 1
 answered on 19 Jan 2010
0 answers
160 views
I get a bug when performing an asynchronous postback in update panel.  I figure its something to do with

if (typeof (Sys) !== "undefined") Sys.Application.notifyScriptLoaded();

Details of the bug I get is below

Sys.ScriptLoadFailedException: The script '/ScriptResource.axd?d=IJ-vAn-30ismm7-uprXJuI148iaeogJGCciJZA9DwrcMzGkIpeKRdEhUD4HkSPf3fJGG4bGPA5tIWtmpqMB1iA2&t=ffffffff80166a94' contains multiple calls to Sys.Application.notifyScriptLoaded(). Only one is allowed.


Mon NN.
Mon NN
Top achievements
Rank 1
 asked on 19 Jan 2010
1 answer
108 views
I am trying to throw together a demo application using some of Telerik's controls.  I have places a RADMenu at the top and then have a RADSeparator in the page as well.  I am guessing you guys use alot of absolute positioning in your controls otherwise I am missing something.  I have dropped a map control into the right pane with a width of 100% and a height of 100% but the controls end up being to big by about 20 - 30 pixels.  Is this because of some sort of positioning that you guys are using and if so I guess I am going to have to brush up on my CSS in order to make this work?

Thanks.
Curtis
Dimo
Telerik team
 answered on 19 Jan 2010
0 answers
86 views
iam binding the scheduler with 2 tables 1st one table is binding with recurence rule and 2nd is with starttime and endtime with union query..

when i drag the appointment which is binding with 1st table it gets error like objectreference is not set to be instance
 
when i drag the appointment which is binding with 2nd table it is working fine...


How can i  modify that error....
Nagesh Mynedi
Top achievements
Rank 1
 asked on 19 Jan 2010
2 answers
174 views
hi

This is the path i have save into the DB:

/upload/9d08d0640453a041f10b5b307bcfffa7fd71\9d08d0640453a041f10b5b307bcfffa7fd71.pdf

did you notice that / / \ slashes? How do i change the \ to /?

and this is the code:

Dim filename As String = System.Guid.NewGuid().ToString.Replace("-", "0")
        Dim filepath As String = "~/upload/" & filename
        Directory.CreateDirectory(Server.MapPath(filepath))
        For Each f As UploadedFile In RadUpload1.UploadedFiles
            f.SaveAs(Path.Combine(Server.MapPath(filepath), filename + f.GetExtension))
           Save(Path.Combine(filepath, filename + f.GetExtension).ToString)
 Next

Will i have any problems if i would to just leave it as it is?
L
Top achievements
Rank 1
 answered on 19 Jan 2010
2 answers
109 views
Hi,
I am trying to get all RadDock and RadDockZone objects. Code goes like this:

First I get all IDs from a page since controls are generatet from code behind:

$('.RadDockingZone').each(function() {
            var testZone = this;
            zoneIDs.push(testZone.id);
        });

$('.RadDockableObjectFixed').each(function() {
          var testDock = this;
          dockIDs.push(testDock.id);
 });

This is a part of code that creates problems:

for (i = 0; i < dockIDs.length - 1; i++) {
        var zone = $find(zoneIDs[i]);
        var dock = $find(dockIDs[i]);        
}

These lines always returns nulls
var zone = $find(zoneIDs[i]);
var dock = $find(dockIDs[i]);     

Any ideas what is causing a problem?
skinflint
Top achievements
Rank 1
 answered on 19 Jan 2010
1 answer
93 views
Hi,

this is am doing one project . I am using rad Ajax controls ,My requirement is RadComboBox SelectedIndexChanged event popup the Radgridview it's ok but when ever click the edit buttton and insertbutton it's refresh and clear the gridview, it,s doesn't working in edit and insert so please send any example it's argent .how to reduce the postback .In this application .am using PreRender event also.

please help me it's argent 



thanks and regards
shanker.b
Daniel
Telerik team
 answered on 19 Jan 2010
3 answers
51 views
dear sir/s,

I am using RadControls for asp.net AJAX 2008 Q3 (2008.3.1314.20)

when using with firefox it works perfectly well but when i viewed same on ie8 submenus are not opening

dont know whats the reason

i am using xml file as menu source

and i am a newbie in this

thanks
Yana
Telerik team
 answered on 19 Jan 2010
3 answers
125 views
I am using a <FormTemplate> to insert rows into a grid. The form by default opens above the existing rows, and directly below the grid column headers. Is it possible to have the edit form open below the last row in the Grid, this way while the edit form is visible, existing rows would appear directly below the grid column headers.
Princy
Top achievements
Rank 2
 answered on 19 Jan 2010
2 answers
117 views
I have created a user control to act as a placeholder for a number of common dialogs and it works just as you would expect.

Except...

One of the windows needs a OnClientClose function and, each calling page is going to need to do something different. So, in my CommonDialogs control I have this ...
    function OpenCommonGroupSubscription(OnClientClose) { 
      var manager = $find("<%= wmCommonDialogs.ClientID %>"); 
      var wnd = manager.getWindowById("<%= winGroupSubscription.ClientID %>"); 
      if (OnClientClose != null && OnClientClose != "") { 
        wnd.add_close(OnClientClose); 
      } 
      wnd.show(); 
      return false
    } 

My calling code looks, called from the codebehind of the main page, looks like this ...
LocalManager.ResponseScripts.Add("OpenCommonGroupSubscription('SubscribeToGroups_ClientClose');"); 

And this is the definition of the function in the markup of the main page ...
      function SubscribeToGroups_ClientClose(sender, args) { 
        setTimeout(function() { 
          AjaxRequestWithTarget("<%= btnHiddenPostback.UniqueID %>""SubscribeToGroups;"); 
        }, 500); 
      }

Now, if I have the definition of the GroupSubscription window on the main page and I have the OnClientClose function name in the <RadWindow> definition, everything works, but the set up described above when the GroupSubscription window closes, I get a JavaScript error ...

a[b] is not a function
http://localhost/v1.1/MyApplication/Telerik.Web.UI.WebResource.axd?_TSM_HiddenField_=ctl00_RadScriptManager1_TSM&compress=1&_TSM_CombinedScripts_=%3b%3bSystem.Web.Extensions%2c+Version%3d3.5.0.0%2c+Culture%3dneutral%2c+PublicKeyToken%3d31bf3856ad364e35%3aen-GB%3a0d787d5c-3903-4814-ad72-296cea810318%3aea597d4b%3ab25378d2%3bTelerik.Web.UI%2c+Version%3d2009.3.1208.35%2c+Culture%3dneutral%2c+PublicKeyToken%3d121fae78165ba3d4%3aen-GB%3a6ed19be3-4ef3-4060-9b74-4985886ad7d9%3a16e4e7cd%3aed16cbdc%3af7645509%3a86526ba7%3a874f8ea2%3a11a04f7e%3a24ee1bba%3ae330518b%3a1e771326%3ac8618e41%3a8e6f0d33%3a6a6d718d%3aa7e79140%3ae524c98b%3a4cacbc31%3ab7778d6c%3aaa288e2d%3a58366029%3a19620875%3a33108d14%3abd8f85e4%3a39040b5c%3af85f9819
Line 6

If anyone can shed any light on this, I'd be grateful.
--
Stuart







Stuart Hemming
Top achievements
Rank 2
 answered on 19 Jan 2010
Narrow your results
Selected tags
Tags
+? more
Top users last month
Simon
Top achievements
Rank 2
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
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?