Repeater ProblemVikas Ahlawat15yAsked Jul 26, 2011, 9:10 PM EDT5 answersShareLinkedInXCopy linkSaveI have taken a repeater control and inside it an image control , I want to apply style only on first image , how can i do this , that when i bind the data then style apply on first image like onitemdatabound="categoryimageRepeater_ItemDataBound1">
Repeater ProblemVikas Ahlawat15yAsked Jul 26, 2011, 9:10 PM EDT5 answersShareLinkedInXCopy linkSaveI have taken a repeater control and inside it an image control , I want to apply style only on first image , how can i do this , that when i bind the data then style apply on first image like onitemdatabound="categoryimageRepeater_ItemDataBound1">
Suthish NairRank #92 · 22.8K reputation15y agoPosted Jul 26, 2011, 9:35 PM EDT0Apply the logic on ItemDataBound event, skip the first row and apply logic from second row on wards.http://forums.asp.net/t/1343265.aspx/10
Vikas AhlawatRank #2,648 · 525 reputation15y agoPosted Jul 27, 2011, 12:33 AM EDT0can anybody give ex according to my repeater?0
Suthish NairRank #92 · 22.8K reputation15y agoPosted Jul 27, 2011, 1:46 AM EDT0did u tried what i suggested?0
Vikas AhlawatRank #2,648 · 525 reputation15y agoPosted Jul 27, 2011, 3:30 AM EDT0Yes i have tried it as static int i=0; protected void categoryimageRepeater_ItemDataBound1(object sender, RepeaterItemEventArgs e) { i++; if (i == 2) { Image img = (Image)categoryimageRepeater.Items[0].FindControl("categoryImageButton"); // img.Style = "display:block;"; img.Style.Add("display", "block"); } }But it is not working the result is below.Albums/519-accessories/1.jpg" style="border-width:0px;" />Albums/285-dresses/1.jpg" style="border-width:0px;" />Albums/664-blazers%20&%20jackets/2.jpg" style="border-width:0px;" />Albums/18-intimate%20apparel/1.jpg" style="border-width:0px;" />0Vikas AhlawatRank #2,648 · 525 reputation15y agoPosted Jul 31, 2011, 9:29 PM EDT0any solution ??0Join to answer this questionEvery answer you publish earns 20 SHARP.Create free accountSign inKnow the answer?Answer a question in the forums and earn +20 SHARP for every answer.See unanswered questionsForumsTop experts01Arun PottiAnswers in the forums20answers02Tahir AnsariAnswers in the forums5answers03Kamlesh KumarAnswers in the forums5answers04Sam HobbsAnswers in the forums4answers05Željko PerićAnswers in the forums3answers?YouYour name goes here.Every answer: 20 SHARP.JoinFull leaderboard →2026DevSocialUpcoming · 3rd editionAI Agents ConferenceDec 1–3, 2026Live onlineFree to attend5days leftRegister
Suthish NairRank #92 · 22.8K reputationPosted Jul 26, 2011, 9:35 PM EDT
http://forums.asp.net/t/1343265.aspx/1
Vikas AhlawatRank #2,648 · 525 reputationPosted Jul 27, 2011, 12:33 AM EDT
Suthish NairRank #92 · 22.8K reputationPosted Jul 27, 2011, 1:46 AM EDT
Vikas AhlawatRank #2,648 · 525 reputationPosted Jul 27, 2011, 3:30 AM EDT
static int i=0;
protected void categoryimageRepeater_ItemDataBound1(object sender, RepeaterItemEventArgs e)
{
i++;
if (i == 2)
{
Image img = (Image)categoryimageRepeater.Items[0].FindControl("categoryImageButton");
// img.Style = "display:block;";
img.Style.Add("display", "block");
}
}
But it is not working the result is below.
Vikas AhlawatRank #2,648 · 525 reputationPosted Jul 31, 2011, 9:29 PM EDT
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questionsTop experts