F
francois
Hi,
I have a little problem
I am using a stored procedure to retrieve my date.
What I want to achieve is to be able to "skip" some row from the resultset i
retrieve back from the stored procedure. To be clear, when I Bind my
repeater I want to be able to skip some records in my repeater and not
display anything at all for that record. I do some calculation on the data i
retrieve to decide if i will bind that row or not.
In my code, in the itemDataBound even handler, I do not execute anything in
the case My calculation decide that that specific record should not be
binded. But my problem is that the row of the repeater is still displayed
eventho there is no data inside (as for that row, i do not assign any value
to the controls of that row)
I hope I am clear...
the code look like
in the page_load
reader = cmd.ExecuteReader();
RepeaterPriceChange.DataSource = reader;
RepeaterPriceChange.DataBind();
reader.Close();
in the ItemDataBound event handler of the Repeater
if (condition == true)
{
// get values for this record and assign them to the controld in the
columns of the current row of the repeater
}
else
{
// skip this record (does not work property, the repeater still display
a row with empty values in the controls of that row
}
Then is it possible to skip and all row of repeater? If yes how to do?
Best regards,
francois
I have a little problem
I am using a stored procedure to retrieve my date.
What I want to achieve is to be able to "skip" some row from the resultset i
retrieve back from the stored procedure. To be clear, when I Bind my
repeater I want to be able to skip some records in my repeater and not
display anything at all for that record. I do some calculation on the data i
retrieve to decide if i will bind that row or not.
In my code, in the itemDataBound even handler, I do not execute anything in
the case My calculation decide that that specific record should not be
binded. But my problem is that the row of the repeater is still displayed
eventho there is no data inside (as for that row, i do not assign any value
to the controls of that row)
I hope I am clear...
the code look like
in the page_load
reader = cmd.ExecuteReader();
RepeaterPriceChange.DataSource = reader;
RepeaterPriceChange.DataBind();
reader.Close();
in the ItemDataBound event handler of the Repeater
if (condition == true)
{
// get values for this record and assign them to the controld in the
columns of the current row of the repeater
}
else
{
// skip this record (does not work property, the repeater still display
a row with empty values in the controls of that row
}
Then is it possible to skip and all row of repeater? If yes how to do?
Best regards,
francois