M
miladhatam
can i set the visibility of an item of datalist to false ?
for eg :
Item.visible = false;
for eg :
Item.visible = false;
Can be simplified toif (DataList1.Items.Count % range > 0)
{
numeric1.listSize = (DataList1.Items.Count / range) + 1;
}
if (DataList1.Items.Count % range == 0)
{
numeric1.listSize = (DataList1.Items.Count / range);
}
for (int i = range; i < DataList1.Items.Count ; i++)
{
DataList1.Items.Controls.Clear();
}
i did it myself
protected void Page_Load(object sender, EventArgs e)
{
int range = 2;
int p = Convert.ToInt16(Request["page"].ToString());
if ( p ==0)
p=1;
if (DataList1.Items.Count % range > 0)
{
numeric1.listSize = (DataList1.Items.Count / range) + 1;
}
if (DataList1.Items.Count % range == 0)
{
numeric1.listSize = (DataList1.Items.Count / range);
}
if (p == 1)
{
for (int i = range; i < DataList1.Items.Count ; i++)
{
DataList1.Items.Controls.Clear();
}
}
else
{
for (int i = 0; i < (p-1)*range ; i++)
{
DataList1.Items.Controls.Clear();
}
for (int i = range*(p) ; i < DataList1.Items.Count; i++)
{
DataList1.Items.Controls.Clear();
}
}
}
Want to reply to this thread or ask your own question?
You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.