How to find all Created Items in a Repeater
-
Hi, maybe somebody can help me further, I have a Repeater [Group Repeater], who created a group and in the RepeaterGroup is another Repeater [Skill Repeater], repeats many of the skills of the Group. So how can I find out whether two groups were already created, to get them and put them in other DIV and add CSS-Style? should look like this Click here
-
Hi, maybe somebody can help me further, I have a Repeater [Group Repeater], who created a group and in the RepeaterGroup is another Repeater [Skill Repeater], repeats many of the skills of the Group. So how can I find out whether two groups were already created, to get them and put them in other DIV and add CSS-Style? should look like this Click here
Why dont you increase a counter on ItemDataBound of the repeater ? I think this would be the easiest way to do this.
Abhishek Sur **Don't forget to click "Good Answer" if you like this Solution.
Visit My Website-->**
-
Why dont you increase a counter on ItemDataBound of the repeater ? I think this would be the easiest way to do this.
Abhishek Sur **Don't forget to click "Good Answer" if you like this Solution.
Visit My Website-->**
-
Currently, there are a total of 7 groups. I think you should put a counter and if a number is unbarred then DIV to left otherwise DIV to the right?
Whatever the logic suits you... apply any logic. Just handle the counter from two ItemDataBound events of both the repeaters. Also make sure you constraint away the ItemTypes for Header and Footer templates. :thumbsup:
Abhishek Sur **Don't forget to click "Good Answer" if you like this Solution.
Visit My Website-->**
-
Whatever the logic suits you... apply any logic. Just handle the counter from two ItemDataBound events of both the repeaters. Also make sure you constraint away the ItemTypes for Header and Footer templates. :thumbsup:
Abhishek Sur **Don't forget to click "Good Answer" if you like this Solution.
Visit My Website-->**
-
Check this, you will get the idea : http://www.codeguru.com/csharp/.net/net_asp/tutorials/article.php/c12065[^] :thumbsup:
Abhishek Sur **Don't forget to click "Good Answer" if you like this Solution.
Visit My Website-->**
-
Check this, you will get the idea : http://www.codeguru.com/csharp/.net/net_asp/tutorials/article.php/c12065[^] :thumbsup:
Abhishek Sur **Don't forget to click "Good Answer" if you like this Solution.
Visit My Website-->**
I have read it I mean create outside the function the counter. if the counter has reached 2, then I'll get the created controls and put them into the new DIV with CSS... Thats my GroupRepeater ItemdataBound
protected virtual void RepeaterGroup_ItemdataBound(object sender, RepeaterItemEventArgs e) { MuMSkillGroup group = (MuMSkillGroup)e.Item.DataItem; SkillGroupControl currentGoup = (SkillGroupControl)e.Item.FindControl("Skillgroup"); currentGoup.CurrentGroupName = group.SkillGroupName; currentGoup.IsMatrix = false; currentGoup.BindAsMyskillpage = true; }
-
I have read it I mean create outside the function the counter. if the counter has reached 2, then I'll get the created controls and put them into the new DIV with CSS... Thats my GroupRepeater ItemdataBound
protected virtual void RepeaterGroup_ItemdataBound(object sender, RepeaterItemEventArgs e) { MuMSkillGroup group = (MuMSkillGroup)e.Item.DataItem; SkillGroupControl currentGoup = (SkillGroupControl)e.Item.FindControl("Skillgroup"); currentGoup.CurrentGroupName = group.SkillGroupName; currentGoup.IsMatrix = false; currentGoup.BindAsMyskillpage = true; }
if (CountGroup == 6) { Repeater getGroupRepeater = (Repeater)sender; foreach (RepeaterItem rptItem in getGroupRepeater.Controls) { foreach (Control ctrl in rptItem.Controls) { if (ctrl is Panel) { Panel panelGlobalContainerBox = (Panel)ctrl; if (countItemdataBound) { panelGlobalContainerBox.CssClass = "content_left"; //panelGlobalContainerBox.BackColor = System.Drawing.Color.Red; countItemdataBound = false; } else { panelGlobalContainerBox.CssClass = "content_right"; //panelGlobalContainerBox.BackColor = System.Drawing.Color.Green; countItemdataBound = true; } } } } }
THX Abhishek Sur for your Time its solved now -
if (CountGroup == 6) { Repeater getGroupRepeater = (Repeater)sender; foreach (RepeaterItem rptItem in getGroupRepeater.Controls) { foreach (Control ctrl in rptItem.Controls) { if (ctrl is Panel) { Panel panelGlobalContainerBox = (Panel)ctrl; if (countItemdataBound) { panelGlobalContainerBox.CssClass = "content_left"; //panelGlobalContainerBox.BackColor = System.Drawing.Color.Red; countItemdataBound = false; } else { panelGlobalContainerBox.CssClass = "content_right"; //panelGlobalContainerBox.BackColor = System.Drawing.Color.Green; countItemdataBound = true; } } } } }
THX Abhishek Sur for your Time its solved nowYou are most welcome my friend. :thumbsup:
Abhishek Sur **Don't forget to click "Good Answer" if you like this Solution.
Visit My Website-->**