From: Mr. Arnold on
3P wrote:
>>> And where do You do one time bind of data if not in PageLoad?
>>> How if (!IsPostback) is used in Button.Click? Please show.
>>
>> The !IsPostback is about loading the control the very first time the
>> page is loaded with the control loaded and page rendered. You could
>> have passed some kind of initial filter to the dataload and loaded the
>> control out the gate.
>
> And I said about loding it at the button click not at the PageLoad right?

Again not user friendly missing initial pageload and loading that control
>>
>> There is nothing worst than a page coming up the first time the page
>> is loaded and a control such as a gridview is blank. And then I the
>> user must set a filter and load it the first time with a button?
>
> Total nonsense. Database contains hundreds of tousands or records. Why
> waste
> users time,

I guess you never heard of a Select Where or Like statement.

hit the database, and show him the data that he doesn't want?
You never ask the user if the first page loads that there can be a
staring point on limited data shown? Who said anything about pulling 100
of thousand of records?

> And did You think for a second that this may be what user required?
> Showing data after button click?

You think it's ridiculous to give the user a starting point? What's with
your filter and limiting what gets shown first? It's better than a
double button-clicking. And you asked the users or the one power user of
the application or anybody in quality assurance about functionality?
>
>>
>> The ispostback has NOTHING to do with your button-click. But it's a
>> way of making the page more user friendly so the user doesn't have to
>> do some ridiculous button-click to initially load the control. It
>> should already be loaded initially.
> Yeah run some SQL on 1 mil records and display without any filter. User
> has to wait
> for page to load and then still has to set the filter to se the data that
> he's interested in.
>
>>
>>>
>>>> And if you tell me that the control can only be loaded on user
>>>> clicking a button at application start, then it's ridiculous and
>>>> totally unuser friendly.
> What application start? Do You understand english at all? Have You seen
> any form
> containing filter on top of it and then grid showing data filtered with
> this filter?

At one point, there was something on a response.redirect or
server.transfer that initially started that page initial application
start. Do you understand anything period is the question?
>
>>>>
>>> What? That was very simple. Setup filter then presh show me the data.
>>> Then setup new filter and press show me the data again.
>>> What is "unuser friendly"? (whatever that means).
>>
>> It's ridiculous, and if I were the end-user or quality tester, it
>> would certainly hit the trash can as unnecessary functionality. The
>> control should have been initially loaded with data.

> And if I were I would ask why this page loads so slow and why does it
> show me data
> I dont give a f... about. And I would ask why the hell did You make it
> show data
> when I told you to do it on button click.

LOL, this is one of you can't think out side the box, and give the
illusion of speed.
>
>>
>>>
>>>>> And the question was if I can stop ObjectDatasource refresh data
>>>>> on every postback.
>>>>
>>>> How are you going to tell a OBJECTDATASOURCE that you bound at the
>>>> ASP.aspx to NOT go back to the database on a POSTBACK? YOU CAN'T DO IT!
>>> I can handle Selecting event and set e.Cancel = true; and it doesn't
>>> hit the database
>>
>> Why would you be selecting a row, and the selection of the row causes
>> it to go back to the database? It seems to me that event needs to be
>> disabled.

>
> Who is talking about selecting a row!? And where? You clearly have no idea
> what You talking about.

What? You're talking about the SelectedIndexChanged? There are not that
many events on the controls. And most of them are about the same. Don't
think that you're some of expert on controls now.

And even at that, based on any type of event fired, why is it attempting
to go back to the database, period, and you have to cancel up out of it.
:) There is something wrong there. You got AutoPostBack on the control
enabled? Maybe, you need to disable that too. :)

Like the health care bill, maybe you need to start over. :)

I have forgotten more in my approaching some 40 years in professional
programming in CICS, TSO, Windows desktop and Web controls than I care
to mention, but I am not expert.

>
>>> Nevermind now. The only way to do it is inherit from GridView
>>> control and override
>>> InitializePager. Then I can do
>>> btn_Click(...)
>>> {
>>> grid.NumberOfRows = sth;
>>> grid.Datasource = ds;
>>> grid.DataBind();
>>> }
>>> grid doesn't provide "NumberOfRows" property so You have to inherit
>>> from it to add it.
>>
>> Not to be smart here, I wouldn't waste my time on it, and I would take
>> control of the paging myself using a algorithm and using
>> PageIndexedChanged event to control paging. Or on NeededDataSource and
>> control paging there. I don't know if .Net controls have the event,
>> like RadCcontrols.
>
> Yeah and write Your custom grid from scratch and pager control. There is
> no way
> to tell the grid how many pages to display in pager other then using
> ObjectDataSource
> or by inheriting from GridView.

LOL, you have no clue as to what I am talking about, and you have not
been down the path I have walked.

A simple algorithm in the PageIndexed change event to compute how many
pages and items per page which are properties of the control preset in
the aspx HTML control is no big deal when you using Linq and Entity
Framework over a WCF Web service with 'objects' in a collection :)

Or you can use a WCF RIA service -- wink. :)

From: Mr. Arnold on
3P wrote:
>
>>
>> The ispostback has NOTHING to do with your button-click. But it's a
>> way of making the page more user friendly so the user doesn't have to
>> do some ridiculous button-click to initially load the control. It
>> should already be loaded initially.
> Yeah run some SQL on 1 mil records and display without any filter. User
> has to wait
> for page to load and then still has to set the filter to se the data that
> he's interested in.


About this, you run some SQL that selects 1m records. It seems like
something you might do, based on our conversation to this point.

In the meantime, I'll use ADO.NET Entity Framework, Linq-2-Objects and
query on selection criteria to get a subset out of the 1m records.
Maybe, I only comeback 20 records out of the 1m, an illusion of speed --
wink.
From: 3P on
Dnia 20-03-2010 o 00:17:09 Mr. Arnold <Arnold(a)arnold.com> napisa�(a):

> 3P wrote:
>>>> And where do You do one time bind of data if not in PageLoad?
>>>> How if (!IsPostback) is used in Button.Click? Please show.
>>>
>>> The !IsPostback is about loading the control the very first time the
>>> page is loaded with the control loaded and page rendered. You could
>>> have passed some kind of initial filter to the dataload and loaded the
>>> control out the gate.
>> And I said about loding it at the button click not at the PageLoad
>> right?
>
> Again not user friendly missing initial pageload and loading that control

Customer says I don't want initiali data. Do You understand it? Or do You
tell customer
to get the f... out and that You won't do any software for them?

Poor You. The only software You create is for your fun.

>>>
>>> There is nothing worst than a page coming up the first time the page
>>> is loaded and a control such as a gridview is blank. And then I the
>>> user must set a filter and load it the first time with a button?
>> Total nonsense. Database contains hundreds of tousands or records. Why
>> waste
>> users time,
>
> I guess you never heard of a Select Where or Like statement.
And what where clause You build if there is no filter specified? And so
what that
there is where and like if You still run it when client didn't specify
what he wants.
Yeah run LIKE on 1 mil records when nobody wants it. LOL.

>
> hit the database, and show him the data that he doesn't want?
> You never ask the user if the first page loads that there can be a
> staring point on limited data shown? Who said anything about pulling 100
> of thousand of records?
>
>> And did You think for a second that this may be what user required?
>> Showing data after button click?
>
> You think it's ridiculous to give the user a starting point? What's with
> your filter and limiting what gets shown first? It's better than a
> double button-clicking. And you asked the users or the one power user of
> the application or anybody in quality assurance about functionality?
Reread this sentence. Or learn english!

>>
>>>>>> The ispostback has NOTHING to do with your button-click. But it's a
>>> way of making the page more user friendly so the user doesn't have to
>>> do some ridiculous button-click to initially load the control. It
>>> should already be loaded initially.
>> Yeah run some SQL on 1 mil records and display without any filter. User
>> has to wait
>> for page to load and then still has to set the filter to se the data
>> that
>> he's interested in.
>>
>>>
>>>>
>>>>> And if you tell me that the control can only be loaded on user
>>>>> clicking a button at application start, then it's ridiculous and
>>>>> totally unuser friendly.
>> What application start? Do You understand english at all? Have You seen
>> any form
>> containing filter on top of it and then grid showing data filtered with
>> this filter?
>
> At one point, there was something on a response.redirect or
> server.transfer that initially started that page initial application
> start. Do you understand anything period is the question?
No I don't understand Your english. And I don't understand what
response.redirect
or server.transfer You talk about.
>>
>>>>>
>>>> What? That was very simple. Setup filter then presh show me the data.
>>>> Then setup new filter and press show me the data again.
>>>> What is "unuser friendly"? (whatever that means).
>>>
>>> It's ridiculous, and if I were the end-user or quality tester, it
>>> would certainly hit the trash can as unnecessary functionality. The
>>> control should have been initially loaded with data.
>
>> And if I were I would ask why this page loads so slow and why does it
>> show me data
>> I dont give a f... about. And I would ask why the hell did You make it
>> show data
>> when I told you to do it on button click.
>
> LOL, this is one of you can't think out side the box, and give the
> illusion of speed.
No it's give what client asks for. Keep doing software for fun.
>>
>>>
>>>>
>>>>>> And the question was if I can stop ObjectDatasource refresh data
>>>>>> on every postback.
>>>>>
>>>>> How are you going to tell a OBJECTDATASOURCE that you bound at the
>>>>> ASP.aspx to NOT go back to the database on a POSTBACK? YOU CAN'T DO
>>>>> IT!
>>>> I can handle Selecting event and set e.Cancel = true; and it doesn't
>>>> hit the database
>>>
>>> Why would you be selecting a row, and the selection of the row causes
>>> it to go back to the database? It seems to me that event needs to be
>>> disabled.
>
>> Who is talking about selecting a row!? And where? You clearly have no
>> idea
>> what You talking about.
>
> What? You're talking about the SelectedIndexChanged? There are not that
> many events on the controls. And most of them are about the same. Don't
> think that you're some of expert on controls now.
Now You made me laugh. You really don't know what were talking about here.
What selectedIndexChanged? Can You read? Why would I hit the database on
SelectedIndexChanged?
I'll help You. We were talking about ObjectDataSource. Now get it?


> And even at that, based on any type of event fired, why is it attempting
> to go back to the database, period, and you have to cancel up out of it.
> :) There is something wrong there. You got AutoPostBack on the control
> enabled? Maybe, you need to disable that too. :)
Because ObjectDataSource does it. RTFM!
And there are many AutoPostback controls in filter, because gues what?
They have
to postback to populate dome dropdowns in filter.

>
> Like the health care bill, maybe you need to start over. :)
>
> I have forgotten more in my approaching some 40 years in professional
> programming in CICS, TSO, Windows desktop and Web controls than I care
> to mention, but I am not expert.
>
>>
>>>> Nevermind now. The only way to do it is inherit from GridView
>>>> control and override
>>>> InitializePager. Then I can do
>>>> btn_Click(...)
>>>> {
>>>> grid.NumberOfRows = sth;
>>>> grid.Datasource = ds;
>>>> grid.DataBind();
>>>> }
>>>> grid doesn't provide "NumberOfRows" property so You have to inherit
>>>> from it to add it.
>>>
>>> Not to be smart here, I wouldn't waste my time on it, and I would take
>>> control of the paging myself using a algorithm and using
>>> PageIndexedChanged event to control paging. Or on NeededDataSource and
>>> control paging there. I don't know if .Net controls have the event,
>>> like RadCcontrols.
>> Yeah and write Your custom grid from scratch and pager control. There
>> is no way
>> to tell the grid how many pages to display in pager other then using
>> ObjectDataSource
>> or by inheriting from GridView.
>
> LOL, you have no clue as to what I am talking about, and you have not
> been down the path I have walked.
>
> A simple algorithm in the PageIndexed change event to compute how many
> pages and items per page which are properties of the control preset in
> the aspx HTML control is no big deal when you using Linq and Entity
> Framework over a WCF Web service with 'objects' in a collection :)
>
> Or you can use a WCF RIA service -- wink. :)

And if your not using EF, WCF or WCR RIA it is hard to calculate it!?

LOL. I see You know some technology terms. LOL. OK I will rebuild my app
use
EF, and WCF services to enable paging. Now I'm wondering if Your kidding
or ...

You can't set properties of a grid's pager! Understand? And that's
interesting if You calculate
how many items per page there is.
From: Mr. Arnold on
3P wrote:

<snipped>
<yawn>

You with the cuss words see ya later.
From: Andy O'Neill on

"3P" <nospam(a)serwer.pl> wrote in message news:op.u9r7cbkymsp0fz(a)mcs...
>I would like to create a very simple form.
>
> When client enters it he has a filter to set. Then push the button get the
> data and display in GridView.

Stick a parameter on your objectdatasource.
You can connect that up to whatever control you use to define the filter.
Make the initial selection something won't return anything.
OK it "hits your database" first time off but returns nuthin.

Or have your objectdatasource set up like this but only connect it to your
grid on first postback.